Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Subform Question / Problem

Status
Not open for further replies.

WondersWhy

Technical User
Nov 18, 2001
13
0
0
US
Hi,
I bet this problem has a simple solution. It is too complex for me however so I hope one of you experts can help...

I am attempting to create a form and subform and I am having some problems getting the controls right.

My general task involves creating a main form that is read-only and the sub-form allows creation, deletion, edits, etc.

I have a table that the main form is to read-only... showing sales order "Header" information. I do not want the user of the Access form to have the ability to change any of this data. It is updated nightly with a SQL DTS package.

The subform will show the process tracking "moves" from department to department. The subform will used to populate the process moves table which is linked do the sales order header table using the Sales Order Reference field as a link. Each sales order has many moves associated with it.

I can make it mostly work OK, including the presentation of all "moves" for a given sales order so I am pretty sure that I got the relationship right. The forms wizard did a pretty fair job of figuring out how to arrange the data, so that is further proof that I am almost there.

Here is my main problem. I would like the user to be able to enter the sales order number (the key in the sales order header table), and immediately access that record so they can see customer name, due date, etc. that is the sales order header data as well as all of the subform process "moves" data that the subform is designed to record. I have not been able to figure out how to allow the user to simply enter a sales order number and get that record directly. Right now, users would have to go to the control button at the bottom and click through the sales orders until they get to the one that they are looking for.

I have tried going into design mode for the form itself and cange AllowEdits, AllowAdditions and AllowDeletions to No, but that seems to disable direct access to records in the "read-only" mode. You have to click through the records. If I set the Allow Edits, etc. to yes, I get an error indicating that a primary key cannot allow duplicates. I do not know why the database thinks that when entering a sales order number that already exists, a new record is what I am attempting to add. NO! I want to view the one that I KNOW already exists in the sales order header table.

Summary HowDoI...

How do I make a form read-only when the sub-form is NOT read-only and provide the ability to directly access the main form records by entering the main tables ID?

Thanks in advance for any and all advise!!!

Tony T. in Minneapolis
 
Just lock and/or disenable all the data controls on the main form. And you'll have to use a lookup combo or some such (there are wizards in Access to help you) to move from one ID to another.
 
Hi,

Go to the field containing the Sales Order Number.
press 'CTRL-F' and you'll be shown the Find First/
Find Next dialog.

Enter the Sales Order number that you want to search for
and search for it.

Your form will show the selected record and it's
associated details, i.e. Movements on the Sub Form.

-Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top