Sub Form to display multiple orders (1 Viewer)

DanielDavies

New member
Local time
Today, 19:35
Joined
Mar 13, 2006
Messages
2
I have a subform within a form called orders and the subform gets its information from a field of item ID but i cannot enter another item if i change the information in the form it replaces the info in the subform so i lose the first item ordered i need it to be able to display orders of more than one item

Thanks in advance

Dan D
 

ansentry

Access amateur
Local time
Tomorrow, 04:35
Joined
Jun 1, 2003
Messages
995
The main form should have AutoNumber as Primary key.

The subform should have its primary key as AutoNumber.

The main form's primary key should be in the subform as a number.

The main form should have a relationship with the subform (1-Many).

The easiers way to set it up its to use the Wizard.

Have a look at the attached sample, this should explain how they work.

Open the Main form in design view, then select the control sfrmVehicles (the sub form is only a control on the main form) right click select properties and then data and you will see how they are linked (MainForm & SubForm)
 

Attachments

  • MainFormSubForm.zip
    31.2 KB · Views: 187

W.Dnx.W

Registered User.
Local time
Today, 20:35
Joined
Feb 23, 2006
Messages
51
I have a quesion now...is it possible to add one more subform which would respond when you hit a record in the first subform, and not in the main form. That is what I'm stuck at right now..
 

Bobadopolis

No I can't fix it dammit!
Local time
Today, 19:35
Joined
Oct 6, 2005
Messages
77
Code:
Me.Parent![B]subformName[/B].[B]ControlName[/B]

'or
Me.Parent![B]subformName[/B].[B]Property[/B]

'e.g.
Me.Parent![B]subformName[/B].Requery

'where items in [B]Bold[/B] need to be replaced by your names

I believe
 

W.Dnx.W

Registered User.
Local time
Today, 20:35
Joined
Feb 23, 2006
Messages
51
Can you just check out the link you posted...all I get is Microsoft web site...tnx

D
 

W.Dnx.W

Registered User.
Local time
Today, 20:35
Joined
Feb 23, 2006
Messages
51
ansentry said:
The main form should have AutoNumber as Primary key.

The subform should have its primary key as AutoNumber.

The main form's primary key should be in the subform as a number.

The main form should have a relationship with the subform (1-Many).

The easiers way to set it up its to use the Wizard.

Have a look at the attached sample, this should explain how they work.

One more question...what if my Primary Key is not an AutoNumber but just a Numb, is it possible then to do the same thing. My problem is that I want to show all records in my first subform and not only those who are chosen by the recordselector from the main form. If this has any sence, or in other words, let's say that I would like my Main form to show all records and then when you choose one they change the sub1 and sub2.

D
 

Users who are viewing this thread

Top Bottom