combobox - multifield & as record source

G

Guest

hi,

2 questions:

#1: A combobox is based on a table - and when in pulldown mode is showing 3
columns. Once the selection is made however only one column is left showing.
Would like all 3 to remain showing.

#2: Same combobox - there is a value in a 4th column of this table (not
seen in the combobox when in pulldown mode) - - - - once selection is made -
I would like this unseen 4th column value to show in Form in txtBox1. Code
in AfterUpdate of Combobox?

thanks NTC
 
G

Guest

NetworkTrade said:
hi,

2 questions:

#1: A combobox is based on a table - and when in pulldown mode is showing 3
columns. Once the selection is made however only one column is left showing.
Would like all 3 to remain showing.
Only the bound column shows in the text box portion of a combo
#2: Same combobox - there is a value in a 4th column of this table (not
seen in the combobox when in pulldown mode) - - - - once selection is made -
I would like this unseen 4th column value to show in Form in txtBox1. Code
in AfterUpdate of Combobox?

In the After Update event of the combo:
Me.txtBox1 = Me.ThisCombo.Column(3)
Note: Column numbering for multi column combos starts at 0
 
G

Guest

Check your syntax.
The code needs to be in the form's module in the After Update event sub. Me.
is the abbreviation for Forms!MyFormName, so there should not be a problem.
Make sure the names of the ojbect in the code are correct.
Me.txtBox1 = Me.ThisCombo.Column(3)

Me.txtBox1 should be the name of the text box you want the value from the
4th column of the combo

Change ThisColumn to be the actual name of the combo box.
 
G

Guest

I understand....and I appreciate this forum help so I definitely try to
double check syntax before coming back with a "it doesn't work"....

for some reason my Access is looking for a Macro

I replaced the Me. with the formal
Forms!ThisForm.txtBox1=Forms!ThisForm.ComboBox1.Column(2)

first attempt did nothing and when I returned to design view Access had
added an =

so it was

=Forms!ThisForm.txtBox1=Forms!ThisForm.ComboBox1.Column(2)

there was no error - but txtBox1 was not changing after the Combobox
selection - - is this because txtBox1 is bound to the table value of previous
entry??

when I removed the = then I once again got the error that it could not
find Macro
Forms!ThisForm.

seems like it sees that dot . and thinks it should be a Macro

am confused on this
 
G

Guest

avoiding the 'AfterUpdate' approach; I simply put in the txtBox:
=ComboBox.column(2)

and this works fine. Everytime one updates the ComboBox the txtBox value
changes.

But now the txtBox is unbound and I need the value to go into the Table - -
so am not quite there yet
 
G

Guest

I don't really know why
Me.TextBox = Me.ComboBox.Column(2)
in the After Update event of the combo is not working for your. I would
suggest you check your VBA References to be sure none are missing.
 
G

Guest

Is it because the file format is Access2000?

What are the 'VBA References' ? and how does one check them?
 
G

Guest

The file format has no effect.

Open the VBA Editor
From the Menu Bar Tools, References
See if any say *Missing*
 
G

Guest

well thanks for taking the time to reply.

Followed your advice - and am looking at a long list of References. Begins
with "Visual Basic for Applications" and ends with "ZF-FedEx Library"

don't see anywhere the possibility for something to say 'missing'.....

only the first 4 boxes are checked:

Visual Basic for Applications
Microsoft Access 10.0 Object Library
OLE Automation
Microsoft ActiveX Data Objects 2.1 Library

Not sure if this is correct for Access2003? I would suppose this is machine
specific and not Database Application specific...??
 
G

Guest

Refernces are specific to the object libraries. For Access 2003, it should
actually be 11.0 rather than 10.0. I would also suggest you add the
Microsoft DAO 3.6 Object Library. Those checked are the only ones you are
actually using.
 

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