Originally Posted by
ranman256
you dont need the .value or .text:
Me.txtVehicleNotes = Me.Text103
or
Me.txtSpeed = Me.txtDist / me.txtTime
both of these work.
Also, you dont always need dlookup. you can use combo boxes with 2 columns. 1 col holds the key val, 1 holds the 'dlookup' string val....
if cboVeh has the columns [VehModel],[vehMake] and shows col 1, Model
and the picked item shows CAMERO
the txtMake box can be
txtMake = cboVeh.column(1) to get the MAKE.
txtMake will be CHEVY.
NOTE: in vb code combo boxes start with zero, but in the property window they start with 1.
Thanks for the response.
I'm not using a Combo box to pick the information.
See the screenshot below, All the customer and vehicle information that is greyed out is successfully using the dlookup method, as is the 'vehicle notes' in the footer (it's only visible at the moment for testing purposes, and will be hidden when it works).
The Vehicle Notes field in the footer has the dlookup information, which i wish to pass to the empty, 'Vehicle Notes' section in the main body of the form.
As i said in my original post, a guy on another forum said he used the After_Update on the dlookupbox (Vehicle Notes in the footer a.k.a Text103) to pass the 'looked up' value to the text box (Main body Vehicle Notes a.k.a txtVehicleNotes).
Everything else works perfectly, i just can't figure out the VBA code to set the value for the main body's Vehicle Notes (txtVehicleNotes).
This is the current code i've got, but obviously isn't working.
Code:
Private Sub Text103_AfterUpdate()
Me.txtVehicleNotes = Me.Text103
Me.txtVehicleNotes.Requery
End Sub