G
Guest
I am having difficulty with multiple combo boxes not linking. They come from separate table, but I have a subform that communicates to both tables. Just having trouble writing the code
I am having difficulty with multiple combo boxes not linking. They come from separate table, but I have a subform that communicates to both tables. Just having trouble writing the code
"Having a bad hair day today, huh!!"
Combo2 generates data in the subform. But I need combo3 and combo4 to be able to do the same thing Onchange if I choose to select from those instead. Just a matter of choices from different tables.
Private Sub Combo2_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Error] = " & Str(Me![Combo2])
Me.Bookmark = rs.Bookmark
End Sub
have a form with Combo1 linked to the subform (separate tables). I wouldVee said:Let me try this again, but I prefer you (John Vinson) did not respond. I
Private Sub Combo1_AfterUpdate
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Error] = " & Str(Me![Combo1])
Me.Bookmark = rs.Bookmark
End Sub
Lynn Trapp said:Vee,
I'm afraid I'm just about as puzzled as John is. It would be helpful if you
would answer his question:
If you put similar code on Combo3 and Combo4, what happens? What error
are you getting, or what is the undesired result?
I might also mention that you may not get much help from other people if you
tell John, "...I prefer you (John Vinson) did not respond...." John is one
of the most helpful and knowledgeable people in this, or any other,
newsgroup. He is an excellent forms developer and you shouldn't turn your
ear to what he has to say.
--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
IVee said:Let me try this again, but I prefer you (John Vinson) did not respond.
have a form with Combo1 linked to the subform (separate tables). I would
like to be able to include another combo (from differ table) to pull from
the subform as well. In other words, I want to see everything in the
subform for whatever is specified in Combo1 and Combo2. Just not sure how
the code should read for Combo2. The row and control source for Combo2
selecting from the table itself.Private Sub Combo1_AfterUpdate
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Error] = " & Str(Me![Combo1])
Me.Bookmark = rs.Bookmark
End Sub
Sylvain Lafontaine said:Hum, looks to me as someone trying to use the AND operator with the ADO
version of FindFirst. Unlike the DAO version of FindFirst, this is not
possible with ADO.
He should take a look at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnima00/html/find.asp
Also, replacing "Dim rs As Object" with "Dim rs As ADODB.Recordset" or ""Dim
rs As DAO.Recordset"" (with or without the new operator) should be better.
(The new operator give the option of using early binding instead of late
binding.)
S. L.
Lynn Trapp said:Vee,
I'm afraid I'm just about as puzzled as John is. It would be helpful if you
would answer his question:
If you put similar code on Combo3 and Combo4, what happens? What error
are you getting, or what is the undesired result?
I might also mention that you may not get much help from other people if you
tell John, "...I prefer you (John Vinson) did not respond...." John is one
of the most helpful and knowledgeable people in this, or any other,
newsgroup. He is an excellent forms developer and you shouldn't turn your
ear to what he has to say.
--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
IVee said:Let me try this again, but I prefer you (John Vinson) did not respond.
have a form with Combo1 linked to the subform (separate tables). I would
like to be able to include another combo (from differ table) to pull from
the subform as well. In other words, I want to see everything in the
subform for whatever is specified in Combo1 and Combo2. Just not sure how
the code should read for Combo2. The row and control source for Combo2
selecting from the table itself.Private Sub Combo1_AfterUpdate
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Error] = " & Str(Me![Combo1])
Me.Bookmark = rs.Bookmark
End Sub
people w/o being rude. Perhaps he was having a bad day - but I did not needVee said:It's not a matter of turning away. But there is a way to communicate with