Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box Problem cont.

Status
Not open for further replies.

macky

Programmer
May 22, 2001
26
0
0
GB
I asked a question regarding combo boxes on the 30/5/02 called Combo Box problem, this is a continuation, as the programmer who helped me has not read the sheet and answered my plea for help. I am experiencing a problem with the code below, can anybody assist me, you may have to read the previous question page to understand the problem, I’m sure its quite simple to remedy and I am grateful for any response.

ShowField1 = [comboname].Column(1)
ShowField2 = [comboname].Column(2)
ShowField3 = [comboname].Column(3)
ShowField4 = [comboname].Column(4)


The problem is that I have put the code in the AfterUpdate property using code and the following appears when I try to run it:

Compile Error
Variable Not Defined

When I open the code page for AfterUpdate:

Private Sub termsoftwareno_AfterUpdate() is in yellow
ShowField1 = this part of the code is highlighted Blue and will not run.

 
This usually means that a variable has not been declared. Ensure that ShowField1 has been declared and for the correct data type. Have fun! :eek:)

Alex Middleton
 
Thanks for your reply Alex, but I am still very much on a learning curve. Can you explain in a little more detail.
 
replace ShowField1 through ShowField4 with the Names of the TextBoxes that you want to fill with the data from the ComboBox, and replace comboname with the actual Name of the ComboBox, which according to the AfterUpdate Sub is called termsoftwareno

i.e. if the Name of the TextBox that you want to store the results of column1 in the ComboBox is txtID then use

txtID = termsoftwareno.Column(1)

PaulF
 
Thanks very much for your help, I now understand what i did wrong and the 4 fields are now auto entering from the combo box, BUT the data is not finding its way to the main table so when i close the form i get the message box telling me that i cannot save.

Can you help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top