Jumat, 30 September 2011

[MS_AccessPros] Fields not populating after combo box is clicked

 

Great Day, I have a subform that identifies vehicles that will be repaired at a local mechanic's shop. The customer information comes up in another subform; no problem there. this subform that permits the user to select the vehicle for service, frmJobVehicle Sub is unbound and displays information from qryVehicles - Make,Model, and Tag Number. VehicleID is the first field, but is not displayed, so there are four fields. Here is the SQL for this combo box:

SELECT qryVehicles.VehicleID, qryVehicles.Make, qryVehicles.Model, qryVehicles.[Tag-State]
FROM qryVehicles
ORDER BY qryVehicles.[Make], qryVehicles.[Model];

The combo box permits me to select a vehicle, but after the vehicle is selected, I can't populate the applicable fields. Here is the code that I have in the subform's On Current event:

Private Sub Form_Current()

cboVehicles = Me.txtMakeModelYear2

End Sub


and the after update event code for the combo box is below. I am using this code to try to populate the fields.

Private Sub cboVehicles_AfterUpdate()

Me.txtMakeModelYear2 = cboVehicles
mbResponse = MsgBox("Is this vehicle with tag number " & Me.TagNo & " the correct vehicle for this repair order?", vbYesNo, "Correct Vehicle?")
If mbResponse = vbYes Then
Me.cboVehicles = Me.txtMakeModelYear2
Me.VehicleMake = Me.cboVehicles
Me.txtTagNo2 = Me.TagNo
Me.txtVIN2 = Me.VIN

Else
mbResponse = MsgBox("Please select the correct vehicle.", vbOKOnly, "Correct Vehicle?")
End If
Exit Sub


End Sub

Thanks in advance for your assistance.

Thanks,

David

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar