Double Click on Record Selector Event (1 Viewer)

MooreCreations

New member
Local time
Yesterday, 18:02
Joined
Sep 5, 2008
Messages
3
I have a subform that contains multiple items, a list of records we also have in a form view that shows 1 record at a time. I have all the relationships and ID’s are matching in the tables. For example, I have a subform that contains all current providers working for the currently selected record or contractor above. I have working code that opens the form I need but need to know what code addition I need to make it go record needed based on what record was clicked.
 

MooreCreations

New member
Local time
Yesterday, 18:02
Joined
Sep 5, 2008
Messages
3
Thanks mate, I'm just not seeming to grasp how to make clicking it bring me to a different form view I have. Its basically a list of employee's (or providers in my case) that are in a list form as a subform. This is when the user is surfing different offices and sees who works within that office. I want it to go to that same record ID in a different form that contains more info.
 

pono1

Registered User.
Local time
Yesterday, 18:02
Joined
Jun 23, 2002
Messages
1,186
If I understand what you're asking, there are many ways to do what you want, including using OpenArgs.

Code in the calling form...
Code:
DoCmd.OpenForm "FormNameHere", acNormal, , , , acDialog, ValueofRecordToGet

In the called form's open event handler...
Code:
 If Len(Me.OpenArgs) Then
    Me.Filter = "ValueToGetTextBoxName = " & "'" & Me.OpenArgs & "'"
    Me.FilterOn = True
  End If

Rough example attached.

Regards,
Tim
 

Attachments

  • Copy of Copy of ListBoxToReco.zip
    112.6 KB · Views: 451

MooreCreations

New member
Local time
Yesterday, 18:02
Joined
Sep 5, 2008
Messages
3
Thanks a ton, man. That worked out for me. I had to tie the filter to the last name instead of the numerical primary key I used in the first place. It just seemed to not work with numbers and gave me a data type error. Also, it won't filter correctly if that form is already open. Would you suggest using that on the on current event or using another piece of code that closes the form first if open before applying the new filter when opening a different record? Keep in mind I'm fairly new to VBA and appreciate this help tremendously! Thanks.

Dustin Moore
 

Users who are viewing this thread

Top Bottom