linking forms without subform (1 Viewer)

Patsyoyo

New member
Local time
Today, 01:15
Joined
Apr 30, 2000
Messages
6
In a project database, I have a main form that describes each project and a Step subform that describes each step needed to be taken in the project.

Next I made a modal form so the user could enter time worked on each project. I want the StepNoID control in the modal time entry form to automatically copy the data from the StepNoID form that I execute the modal time entry form from.

I figured out how to make it take the data from the StepNoID, but no matter which record I open the time entry form from, it always takes the data from the first record (just keeps repeating "1"). So the trick is how to take the data from the open record.

Help!
Thanks.
Linda
 

rtg

Registered User.
Local time
Today, 01:15
Joined
Apr 18, 2000
Messages
12
If I understood correctly from your problem description, below is some code that may help. This is used in a Listview control double click event from an application I worked on. The user doubleclicked on a list item in the listview.

The request_ID could be your forms underlying query ID for the appropriate record.

Private Sub LVW_Requests_DblClick()
'opens form from selected line of requests enquiry list
Dim strqstid As String
Dim strform As String
Dim strwhere As String

strqstid = LVW_Requests.SelectedItem.Tag

If strqstid = "" Then Exit Sub

strform = "frm_request"
strwhere = "Request_id = " & strqstid

DoCmd.OpenForm FormName:=strform, wherecondition:=strwhere

End Sub
 

Users who are viewing this thread

Top Bottom