2010 syncing parent form and subform

PattyS

Registered User.
Local time
Today, 09:01
Joined
Jun 20, 2006
Messages
39
hello, just to let everyone know, I am NOT a database designer, I dabble!
I am creating a database for a PD that I work for (writing tickets) so writing CODE is not my thing.

Heres what I want;
objective > supply office needs a database to keep track of uniforms issued with a print out of the current order so the officer can take it to the uniform store. Each officer can return over a period of time and get new items.

heres what I've done;
I created two tables
table1 = EMPLOYEES

fields = ID autonumber
BADGENO > prim Key and is text
RANK
ASSIGNMENT
SHIFT
table2 = INVENTORY with no primary key assigned and is text
fields = BADGNO
DATE
DRESS PANTS
DRESS SHIRT
TIE
excetra...
I made a relationship between the two tables via BADGENO and has
a one-to-many

I then created two forms using the above tables
form1 = UNIFORM ORDERS (EMPLOYEE table) and
form2 = SUBINVENTORY (INVENTORY table)

I opened UNIFORM ORDERS then grabbed the SUBINVENTORY form and
dropped it into the UNIFORM ORDERS form to create the subform

Everything looks good EXCEPT, the two forms dont seem to be linked
I enter infro in the UNIFORM ORDERS form
fill in SHIFT (last field in that form) and the cursor goes to the
BADGENO (first field) in the SUBINVENTORY form
I proceed to complete the order
at the last field in the SUBINVENTORY when I click enter, a new empty
SUBINVENTORY form comes up BUT the UNIFORM ORDERS form does NOT
change (to a new empty record)
and this is also in reverse
when I bring up a already entered officers name in the UNIFORM ORDERS form, his info comes up only in that form and the SUBINVENTORY form
still has the officers orders that I had entered last (not his)

So what have I missed? How do I make only off John Does orders come up
when I put his name into the UNIFORM ORDERS form?

I would love to upload this DB to you but I cant, so you will have to rely on my not so database savy language
Patty
 
Do the following:

Open your UNIFORM ORDERS form in design view.

Select (click on top left corner of) the INVENTORY subform and open the property sheet (right mouse click and select properties)

In the Property Sheet, slect the Data tab.

Enter the name of the field on the UNIFORM ORDERS main form that links to the data in the subform ("BADGENO") in the Link Master Fields

Enter the name of the field on the INVENTORY subform that links to the data in the main form ("BADGENO") in the Link Child Fields

Now view the form
 
post got lost somewhere when I chose to post reply so i wrote another, see below !
 
Last edited:
Red, thank you, this looks like an easy fix but I know enough about Access to know that "this could be dangerous!" I appreciate the manner of your instructions (access for dummies) I needed that, thanks
I am off work for two days, I will try this as soon as I return. Please stand by, I will post the results and would like to keep you as my confidant because of the way you have posted your instructions, thanks again
 
Red, that worked just fine, thank you
I hope that you can continue to help me, your description was easy to follow
Without the programmer jarjon.

I have put a command button on the subform to print a Report that is getting
It's data from the subform it's on
Wanted to know if I could move the command button to the parent form and still have it print the record that is showing in the subform?
This is on the subform
Private Sub PRINT FORM click()
dim strWhere As String
StrWhere = "BADGENO='" & Me.BADGENO & "'"
doCmd.OpenReport "UNIFORM ORDER PAGE",acViewNormal , , strWhere
End sub
 

Users who are viewing this thread

Back
Top Bottom