Using Combo box selection to open form and goto record

veg_racer

New member
Local time
Today, 21:31
Joined
Jan 2, 2014
Messages
9
Hi all, I'm sure this question has been asked a million times on this forum but i am really struggling to navigate around to find my answer.

I have a combo box called Combo9 in form NavigationF, the combo box displays the results of FollowUpQ Query. What I would like to do is when the user selects a row from the combobox is closes NavigationF and opens ContactHistoryF and goes to the record selected in the combo box. I have made sure that the combobox contains CustomerID which is the primary key for my table.

Many thanks in advance.
 
Search for the DoCmd.Openform method and depending on your exact requirements, you will want to use either the Where clause or the OpenArgs of that method
 
Lovely, thanks very much! one more question. I have a yes/no field in the records that i would like to set to false when the record is opened. I have tried to append "FollowUpReq = False" but that doesnt seem to work. hes is the full code:

Private Sub Combo9_AfterUpdate()
Dim strWhereCondition As String
strWhereCondition = "[CustomerID] = " & Combo9
DoCmd.OpenForm "ContactHistoryF", , , strWhereCondition
FollowUpReq = False

End Sub
 
Sussed this now, it was because i wasn't telling it which form the field was on.:D
 
You want to update the customer that you are opening in the form? Then your update should be inside the form...

And if you are updating a control inside a form the syntax is:
Me.FollowUpReq = False
 

Users who are viewing this thread

Back
Top Bottom