Auto Fill the primary key field that is not shown?

M

Meilu

Hi all,

I'm trying to create a forms that is based on a table
with 2 primary keys: Type & Name

Type refers to Agent, Customer, Factory
Name is just the name of the Agent/Customer/Factory.

I want to create a Form for each Type. But I don't want
to have to have the Form contain the Type field.
(Obviously if the user opens a form for 'Agent'
information ... the Type is going to be 'Agent').

The problem is: w/out explicitly entering a Type, Access
says that the field contains a null value, and won't let
me continue. I was wondering if there was a way to auto
fill the Type field in the Table w/out including the Type
in the Form, or asking the user to fill it out?

Any help would be great!
-Meilu
 
J

Joshua A. Booker

Meilu,

Try this:

Add the Type Textbox to the form
Set it's visible property to 'No'
Set it's ControlSource prop to the field 'Type'
Set it's DefaultValue prop to 'Agent'

Do the same for the other two forms using 'Customer' and 'Factory' as
default values respectively.

HTH,
Josh
 

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

Similar Threads

Auto fill field on form 1
auto fill based on another field 4
Auto-Fill Text box on form 4
error 2489 1
auto fill 4
Auto Fill 1
Auto Fill help 23
Primary Keys 2

Top