Event Procedure Problem? (1 Viewer)

MiAs

Registered User.
Local time
Today, 03:17
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)
 

Fizzio

Chief Torturer
Local time
Today, 11:17
Joined
Feb 21, 2002
Messages
1,885
try

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

MiAs

Registered User.
Local time
Today, 03:17
Joined
Oct 25, 2004
Messages
49
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

  • Sample.zip
    16.9 KB · Views: 110
Last edited:

ChrisO

Registered User.
Local time
Today, 20:17
Joined
Apr 30, 2003
Messages
3,202
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

  • Sample_A97_Fix_V1.zip
    8.9 KB · Views: 103

MiAs

Registered User.
Local time
Today, 03:17
Joined
Oct 25, 2004
Messages
49
Thanks ChrisO
I can see where you are coming from.
 

MiAs

Registered User.
Local time
Today, 03:17
Joined
Oct 25, 2004
Messages
49
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.
 

ChrisO

Registered User.
Local time
Today, 20:17
Joined
Apr 30, 2003
Messages
3,202
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

  • Sample_A97_Fix_V2.zip
    18.3 KB · Views: 101

MiAs

Registered User.
Local time
Today, 03:17
Joined
Oct 25, 2004
Messages
49
Thanks for that Chris.
We are using the combobox - textbox setup at present which is working fine.
 

Users who are viewing this thread

Top Bottom