How to reference fields/objects on a form

G

Guest

Hello,

Can anyone help me understand how to reference the fields/objects on a form
when querying/updating database tables?

Example: Form name = "frm_Cont_master"
1. SSN (text box)
2. First name (text box)
3. Last Name (text box)
4. Company (Assume this is a combo box selecting Company name and/or
Company ID number from a seperate lookup table).
5. Department (Assume this is combo box selecting department name/number
from 2nd lookup table, based on the value in #4 above). Assume Company ABC
has departments 1-5 and Company XYZ has departments 6-9. Selecting ABC in #4
will yield a list with departments 1-5.

Assume the form name is frm_Cont_master. Each field on the form will be
stored in 1 or more tables.

I will be performing updates so I do I refer to each object on the form so I
can format the SQL update statement?

Thanks in advance,
 
G

Guest

To reference the form objects in a query it is:
[Forms]![NameOfForm]![NameOfControl]

Now, based on your post, I highly suspect your database design.
Why are you updating multiple tables with the same control (Not Field,
fields are in tables and queries, controls are on forms)? This violates
database normalization rules.
Why are you not using bound forms?

I really think you need to reconsider your design.
 
G

Guest

Rich,

I assume you are trying to create a filter system that allows you to enter
values in one or more of these controls which will then filter your
recordset. Is that accurate?

If so, check out Allen Browne's site (I think this is the right URL:
http://allenbrowne.com/ser-62.html)

HTH
Dale
 

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