Refreshing a field, not an entire form

S

Sandy

Hello -

I have a form with several required fields.

I want to be able to refresh the data in one dropdown field on GotFocus,
based on the data in another dropdown field.

DD Field 1 is called categories
Cat_ID Category
1 Accommodation
2 Agriculture, Forestry and Fishing
3 Animals and Pets

DD Field 2 is called Sub-Categories
CatID Sub Category
1 Bed and Breakfast
1 Camping and Caravans
1 Hostels

the row source for the Sub-Categories field is:

SELECT SubCategories.[Sub Category], SubCategories.CatID
FROM Categories INNER JOIN SubCategories ON Categories.Cat_ID =
SubCategories.CatID
WHERE (((SubCategories.CatID)=[Forms]![Listing Form].[category]))
ORDER BY SubCategories.[Sub Category];


When the data in the Category field changes, how do I set the refresh on the
Sub-Category field only and not the form? Since all the fields are not
entered yet I get an error for the empty required fields.

thank you
sandra
 
S

Sandy

I got it -

[Forms]![Listing Form]![Sub Category].Requery

sorry for having a slow brain today :)
 
B

Beetle

In the AfterUpdate event of your categories combo box put;

Me![sub categories].Requery

HTH
 

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