Dynamically Update Fields

MrAustin

Registered User.
Local time
Today, 11:48
Joined
Oct 4, 2004
Messages
32
Good evening everyone.

I just had a quick question. Before that, here is my current table setup:

tblCustomer_Info (holds relevant customer info)
tblOrders (holds relevant individual order info)
tblCards (holds numbers relating to each card for each member)

What I am trying to accomplish on my order form is this: There is a combobox at the top to select a customer. Well, some of the orders I receive are simply CC slips with no customer name. I want to have access dynamically fill in the customer name when the last four digits of the card number matches the customer. I have the cards linked to the customer in a relationship.

Any thoughts?
 
MrAustin,

You can make an unbound combo-box on your form. Set its
RowSource to either a query or this SQL:

Code:
Select CardNumber, Right(CardNumber, 4)
From   tblCards
Order By Right(CardNumber, 4)

Set the column count for the combo = 2
Set the widths = 0";1"

This way the real number is invisible, but is accessible
by referencing: Me.YourCombo.Column(0).

Wayne
 
So how would I then write the code for txtCard_Num so that when I enter 4477 it automatically locates the appropriate customer and sets the cboCustomerName to that value?

Thanks Wayne!
 
MrAustin,

It depends on how you have your forms set up. Can you post
a sample?

Tools --> Database Utilities --> Compact/Repair
ZIP
Then attach.

Wayne
 
WayneRyan said:
MrAustin,

It depends on how you have your forms set up. Can you post
a sample?

Tools --> Database Utilities --> Compact/Repair
ZIP
Then attach.

Wayne

I will post it tomorrow. I have it at work and unfortunately MS Outlook 2003 likes to block other MS attachments as dangerous items. I'll email it to my Gmail account and try that. Thanks.
 
MrAustin,

OK, fine.

If you can, post it in A97 or A2000 (wider readership).

Wayne
 
Okay, I can't post it because I can't seem to get it home (and don't want to recreate the whole thing from memory) so here is as best as I can describe it.

tblCustomer_Info
- cust_id (autoincrement, prim key)
- txtAccountName

tblOrders
- cust_id (linked)
- order_id (autoincrement, prim key)

tblCards
- card_id (autoincrement, prim key)
- cust_id
- card_num (last four digits only)

I have no idea if that helps or not. The Orders form has a cboCustomerSelect combobox that displays the name but stores the id for relational purposes. It also has a four digit text field named txtCardNum. What I want the text field to do is either onChange or onExit locate the customer name by relating the card with the name in the tblCards table and then automatically enter the name into the cboCustomerSelect combobox.

I'm confusing myself here, so if you are too, just say so. Thanks!
 

Users who are viewing this thread

Back
Top Bottom