Q: on a simple form design

  • Thread starter Thread starter Inma
  • Start date Start date
I

Inma

Hello,

Perhaps I'm not seeing the trees in a forest but I'm totally stumped.

I've two simple tables, CUSTOMERS and EXPENSES. The latter has CUSTOMER_ID
as a link to the first table (CUSTOMERS.CUSTOMER_ID <->
EXPENSES.CUSTOMER_ID).

I need to create a form to input data in the EXPENSES table selecting the
customer name from CUSTOMERS.

How would I go by?

TIA

Inma
 
Inma said:
Hello,

Perhaps I'm not seeing the trees in a forest but I'm totally stumped.

I've two simple tables, CUSTOMERS and EXPENSES. The latter has
CUSTOMER_ID as a link to the first table (CUSTOMERS.CUSTOMER_ID <->
EXPENSES.CUSTOMER_ID).

I need to create a form to input data in the EXPENSES table selecting
the customer name from CUSTOMERS.

How would I go by?

Multiple methods are available, but here is what I would do...

Create a form bound to the Customers table displaying everything you want to see
about the customer. Then add an unbound ComboBox labelled "Go To...". The
RowSource of that ComboBox should include CUSTOMER_ID and CUSTOMER_NAME with
CUSTOMER_ID being the bound column (hidden if you like). In the AfterUpdate
event of the ComboBox have code...

Me.Filter = "CUSTOMER_ID = " & Me!GoToComboBoxName
Me.FilterOn = True

You now have a simple Customer form with an easy ability to view any one
customer by using the ComboBox.

Now create a continuous view form bound to the Expenses table and format how you
want it to look. When finished you can open the Customer form in design view
and drag the expenses form from the db window onto the customer form and Access
will automatically add the expenses form as a subform.

It is important that the linking field CUSTOMER_ID be entered into the
MasterLink and ChildLink properties of the subform. If you have these
relationships defined in the relationships window then Access should insert the
property values automatically (check them anyway).

Now when you move from customer to customer with the ComboBox you will see each
customers expenses in the subform and can make edits and insertions.
 
Thank you much Rick.

I followed your steps but when I run the main form, a popup windows askes
for the CUSTOMER_ID. I don't understand it! I did link the field as
Master/Child. What am I missing?
Inma
 
Yes. However, when I draged the expenses form into the customer one, Access
did't set up the Master/Child field. So I did it manually. I also have a
query for both tables and works fine.

Rick Brandt said:
Inma said:
Thank you much Rick.

I followed your steps but when I run the main form, a popup windows
askes for the CUSTOMER_ID. I don't understand it! I did link the
field as Master/Child. What am I missing?
Inma

Are you absolutely positive that both form's RecordSets have a field with
that exact name?

If you reset those properties using the builder (the [...] button to the
right of either one), then you are given the option of choosing fields
from
the RecordSets of each form and therefore it should be impossible to pick
an
invalid one or get the spelling wrong. I would try that.
 
Inma said:
Thank you much Rick.

I followed your steps but when I run the main form, a popup windows
askes for the CUSTOMER_ID. I don't understand it! I did link the
field as Master/Child. What am I missing?
Inma

Are you absolutely positive that both form's RecordSets have a field with
that exact name?

If you reset those properties using the builder (the [...] button to the
right of either one), then you are given the option of choosing fields from
the RecordSets of each form and therefore it should be impossible to pick an
invalid one or get the spelling wrong. I would try that.
 
Back
Top