G
Guest
At the end of this message I have listed a Sub routine that Access 2003
automatically generated in the AfterUpdate event of a combo box. This Sub
syncs the combo box to the Form when the combo box changes.
I want understand how this code works so I can make changes if needed. I
have work for days to understand it and think I have most of it down. Except,
I do not understand the programming syntax this line of code:
rs.FindFirst "[TP-Key] = " & Str(Nz(Me![Combo8], 0))
I how it works, it searches for the first record in the recordset that is
equal to the value in the combo box combo8. I understand “rs.FindFirst†and
also “(Nz(Me![Combo8], 0†parts. But the -- "[TP-Key] = " & Str -- syntax I
have not been able to understand …..why is there a -- &-- and the quotes
around the --"[TP-Key] =.
In general does any one know where I can get this information, I have tried
but was not successful
Thanks for your help
Brad
Private Sub Combo8_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
'this declares variable rs as type Object
Set rs = Me.Recordset.Clone
'This make a duplicate of original in variable rs
rs.FindFirst "[TP-Key] = " & Str(Nz(Me![Combo8], 0))
'This finds the first record recordset that is equal to the
combo8
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
‘This sets the current record of the recordset to the one found
End Sub
automatically generated in the AfterUpdate event of a combo box. This Sub
syncs the combo box to the Form when the combo box changes.
I want understand how this code works so I can make changes if needed. I
have work for days to understand it and think I have most of it down. Except,
I do not understand the programming syntax this line of code:
rs.FindFirst "[TP-Key] = " & Str(Nz(Me![Combo8], 0))
I how it works, it searches for the first record in the recordset that is
equal to the value in the combo box combo8. I understand “rs.FindFirst†and
also “(Nz(Me![Combo8], 0†parts. But the -- "[TP-Key] = " & Str -- syntax I
have not been able to understand …..why is there a -- &-- and the quotes
around the --"[TP-Key] =.
In general does any one know where I can get this information, I have tried
but was not successful
Thanks for your help
Brad
Private Sub Combo8_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
'this declares variable rs as type Object
Set rs = Me.Recordset.Clone
'This make a duplicate of original in variable rs
rs.FindFirst "[TP-Key] = " & Str(Nz(Me![Combo8], 0))
'This finds the first record recordset that is equal to the
combo8
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
‘This sets the current record of the recordset to the one found
End Sub