View Single Post
  #2 (permalink)  
Old April 26th, 2007, 10:10 AM
mmcdonal mmcdonal is offline
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Create a combo box that looks up the task number, tied to the PK of the task table. Call it cboTask

Make sure this number is on your form you want to open.

Then put a button on the first form, call it btnTask

Then put this on the on click event of btnTask

Dim iTask As Integer
Dim sForm, sLink As String

If IsNull(Me.cboTask) or Me.cboTask = "" Then
   MsgBox "Please select a task number.", vbCritical
   End Sub
Else
   iTask = Me.cboTask
End If

sForm = "frmTask"
sLink = "[TaskID] = " & iTask

DoCmd.OpenForm sForm, acNormal, , sLink

'Make sure you put sLink in the WHERE clause of DoCmd, I forget which comma it comes after.

Did that help?



mmcdonal
Reply With Quote