Event Procedure Problem?

MiAs

Registered User.
Local time
Yesterday, 16:38
Joined
Oct 25, 2004
Messages
49
Try this one guys,
I have a form based on a Query with Comboboxes reading a Table.
the Combo's populate Textboxes with code as:

Private Sub Combobox1_AfterUpdate()
Me.Textbox1=Combobox1.Column(1)

End Sub

Combo bound to column 1,Row source=table.
This was created in Access 2000 and works fine, but when tried in '97 Textboxes are not populating.
I cannot figure out what is wrong.
(Need it in '97 for work purposes)
 
try

Private Sub Combobox1_AfterUpdate()
Me.Textbox1=me.Combobox1.Column(1)
End Sub
 
Thanks Fizzio but unfortunately didn't make a difference.
I have created an example (Access 97) if someone could take a look and maybe see whats wrong.
This example works OK in version 2000, confusing me!
 

Attachments

Last edited:
G’day MiAs

The Column Count of the combo boxes was set to 1.

The .Column() property is indexed starting at zero so using .Column(1) was returning a Null.

So in effect the textboxes were being updated with a Null but we just can’t see Nulls.

I tried to add a little naming convention to the attached demo.

Hope that helps.

Regards,
Chris.
 

Attachments

Thanks ChrisO
I can see where you are coming from.
 
Two Way Populating

As a followup to the above,
Is it possible to have two comboboxes or similar setup which populate either way?
I ask this because at present we find a customer by order number but sometimes we do not know this or it is incorrect but we may know customer name.
Thanks in anticipation.
 
G’day MiAs

Sorry for taking so long to get back to you, simply forgot about this thread.

There’s another small demo attached but I changed the table structure to make it a little more ‘normal’.

Hope that helps or is close to what you require.

Regards,
Chris.
 

Attachments

Thanks for that Chris.
We are using the combobox - textbox setup at present which is working fine.
 

Users who are viewing this thread

Back
Top Bottom