By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,513 Members | 1,158 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,513 IT Pros & Developers. It's quick & easy.

Northwind question

P: 3
Hi,
I found this post on the forum in order to get an explanation of the customer ID allow autmatic populate of fields in the order form. However, I followed same procedures from the northwind and do it on my form, and it doesn't work. Can anyone tell me why? thanks

esca007


Open the Orders form in design view.
Open the Properties box.
Ensure the Title of the Properties box says "Form" so you are looking at the
properties of the form, not those of a text box.
Locate the Record Source property (Data tab).

The Record Source is a query.
Open the query in design view.
You will see that the query contains two tables - Orders and Customers.
When you select CustomerID on the form, the query automatically fetches the
matching details from the Customers table.

When you combine multiple tables in the query that is the Record Source of a
form, if you are not careful you will end up with a read-only form, or one
that cannot accept new records, or one that deletes information from the
wrong table (e.g. deleting the customer when all you wanted was to delete an
order).

In general, you are safe if all the editable fields are from the related
table (the "many" side of the relationship), and the other table is just
used as a lookup. That is the case in the Northwind example. In addition,
you will notice that the text boxes bound to fields from the Customers table
(such as the Address field) have their Enabled property set to No and their
Locked property set to Yes. This helps prevent unintentional changes.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html

"Mark" <mcunni01@uoguelph.ca> wrote in message
news:14801530.0310060404.57837282@posting.google.c om...[color=blue]
> OK, on the Form called Orders, there is a combobox that allows you to
> select customers. The form then populates all the textboxes below it
> with the customer information (called: address, city, region, etc...)
>
> How does it populate these textboxes. I have looked in the afterupdate
> function for the combobox but there is nothing no code in there that
> populates the textboxes mentioned above. What is access doing and how
> do you set it up???
>
>
> Thanks[/color]
Sep 24 '06 #1
Share this Question
Share on Google+
3 Replies


PEB
Expert 100+
P: 1,418
PEB
What is your Source query?

have you done the relationship bwn Table Orders and Customers? Have you addes the neded fields from Customers?

In fact when you type your Customer ID the rest of information should appear...

If there is a good relation only ID with ID you can edit the table orders and it should't be locked!

Best regards!

:)
Sep 24 '06 #2

P: 3
Hi,
All the fields are actually from the same table. I have a customer table with customer ID, name, age. They're all in the same table. I put these on a form, and I make customer ID combo box. But when I use the customer ID box to show customer name and age, only the customer ID is changed. The rest stays the same. For instance, the form initially shows ID 122, name John, age 12. If i drop downa and choose ID 123, name and age of ID 123 will not come up even though in the table there's name of Sam and age of 13. John and 12 stays in those boxes. I don't know why it's like that. Please help. thanks

esca007
What is your Source query?

have you done the relationship bwn Table Orders and Customers? Have you addes the neded fields from Customers?

In fact when you type your Customer ID the rest of information should appear...

If there is a good relation only ID with ID you can edit the table orders and it should't be locked!

Best regards!

:)
Sep 24 '06 #3

PEB
Expert 100+
P: 1,418
PEB
So in your case... you need other thing....

Change the control source of the combo box! Now it's Customer ID it must be blank!

It have to be unbound!

Name this field MyID

Then in the recors source of your Form type

SELECT * FROM Customers WHERE CustomerID=[Forms]![MyFormName]![MyID]

Don't copy Paste directly this statement do the changes!

Customers is your table with Customers
CustomerID is your ID int this table

In the Field MyID you need to create an After Update event procedure in which you eneter:

Me.Requery


It's everything!

Best regards!
:)
Sep 25 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.