S
Simon
When i change a combo box how do i code it that it will change
txtInvoiceNumber and txtOrdernumber back to null
Thanks
Simon
txtInvoiceNumber and txtOrdernumber back to null
Thanks
Simon
Wayne-I-M said:Hi
If useing the combo to find a record on your form and then set 2 other
fields to "" use something like this
Private Sub ComboName_AfterUpdate()
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[FormField] = " & Str(Me![ComboName])
Me.Bookmark = rs.Bookmark
Me.txtInvoiceNumber = ""
Me.txtOrdernumber = ""
End Sub
Or, if just wanting to select from combo then set fields to "", use
something like this
Private Sub ComboName_AfterUpdate()
'Some code here - what combo will do'
Me.txtInvoiceNumber = ""
Me.txtOrdernumber = ""
End Sub
Dirk Goldgar said:Wayne-I-M said:Hi
If useing the combo to find a record on your form and then set 2 other
fields to "" use something like this
Private Sub ComboName_AfterUpdate()
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[FormField] = " & Str(Me![ComboName])
Me.Bookmark = rs.Bookmark
Me.txtInvoiceNumber = ""
Me.txtOrdernumber = ""
End Sub
Or, if just wanting to select from combo then set fields to "", use
something like this
Private Sub ComboName_AfterUpdate()
'Some code here - what combo will do'
Me.txtInvoiceNumber = ""
Me.txtOrdernumber = ""
End Sub
Why set them to "" instead of Null, Wayne? The two aren't
interchangeable, and if these text boxes are bound to fields that don't
allow zero-length strings, setting them to "" will cause an error. If
Simon really wants to set the text boxes to Null, the code should be:
Me.txtInvoiceNumber = Null
Me.txtOrdernumber = Null
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)