Separate Forms for each Command Button

S

Sharon

My customer may need one or several audits. Each type of
audit has it's unique form. All of the forms feed off of
one query. Two tables are involved: The Customer Table
and the Audit table.

My menu allows the user to select the type of audit form
through a command button. There are eight different kind
of audits. Examples:

- Commercial - Residential - Multi Family .....

What do I need to do to have Access automatically fill in
the AUDIT TYPE field for that customer with the form that
was completed each time?

ACCOUNT NAME AUDIT TYPE

Customer 1234 1 to many Commercial
Multi Family
Customer 5678 Residential

I am a beginning VB person. Please be specific.

Thanks...
 
R

Rod Scoullar

Sharon,

First of all you need to store the Audit type with each form.

You could do that with a const AUDIT_TYPE = "Residential" etc. at the
top of the VBA code for each form module. If you have a table of audit
types (which you probably should) you would use the audit_type_ID instead of
the word.

I assume your form has a textbox (or combobox) control where you are
entering the audit type at present, say named AuditType

What you need to do is put some code in the Form_OnCurrent event which
copies AUDIT_TYPE into the AuditType control. This will display it on the
form and save it when you save the record.

Rod Scoullar.
 

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