Auto Fill the primary key field that is not shown?

  • Thread starter Thread starter Meilu
  • Start date Start date
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
 
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
 
Back
Top