My Combo Box is not working- PLEASE HELP

N

Need Help

When I select my combo box and either type of select a branch all of the
address information will come up but not the name of the branch which is what
the combo box is. It does the same things for my vehicles. Can someone please
help. Here is the VBA Code:

This is just an example:
Private Sub Vehicle_Unit_No_BeforeUpdate(Cancel As Integer)
Me.Vehicle_VIN = Me.Vehicle_Unit_No.Column(1)
Me.Vehicle_Year = Me.Vehicle_Unit_No.Column(2)
Me.Vehicle_Make = Me.Vehicle_Unit_No.Column(3)
Me.Vehicle_Model = Me.Vehicle_Unit_No.Column(4)
 
N

Need Help

The error message says:

The expression AfterUpdate you entered as the ecent property setting
produced the following error: Procedure decalration does not match
description of event or procedure having the same name
 
D

Douglas J. Steele

Sounds as though you simply changed the first line to

Private Sub Vehicle_Unit_No_AfterUpdate(Cancel As Integer)

The AfterUpdate event has no parameters:

Private Sub Vehicle_Unit_No_AfterUpdate()
 
D

Douglas J. Steele

You need

Private Sub Vehicle_Unit_No_AfterUpdate()
Me.Vehicle_VIN = Me.Vehicle_Unit_No.Column(1)
Me.Vehicle_Year = Me.Vehicle_Unit_No.Column(2)
Me.Vehicle_Make = Me.Vehicle_Unit_No.Column(3)
Me.Vehicle_Model = Me.Vehicle_Unit_No.Column(4)
End Sub

The simplest way is simply to select the Vehicle_Unit_No control in the
left-hand combo box within the VB Editor, and the AfterUpdate event from the
right-hand combo box. That will create the empty skeleton for you:

Private Sub Vehicle_Unit_No_AfterUpdate()

End Sub

You can then cut the code from the old event and paste it into the new
event.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top