Linking of two forms

F

FA

Hi Freinds,
I am stuck at something and asking for your help.
I have the following forms
frmSystem => Table SYS_INFO (PK - SYS_ID_CODE)
frmFindings => Table Finding (PK- FINDG_NO, FK - SYS_ID_CODE)

I want to make a command button on frmSystem that will open frmFindgs
with the same SYS_ID_CODE but a new FINDG_NO (Autonumber).

Each SYS_ID_CODE can have many FINDG_NO . i made a command button but
its opening all the recods from Table Finding for a particular
SYS_ID_CODE.
But instead of showing all the recods i want to add new finding for a
particular SYS_ID_CODE.

Can someone help me out please.

Thanks

Moe
 
R

RM Ashraf

Hi

If I understand your problem right, you can do this by setting the
"DataEntry" property true for the Findings form. This will enter the form
with a blank record to enter data. For the key I normally use OpenArg
argument of OpenForm. It is the last argument in call. U can pass the key
value as string and the set the default value of foreign-key to Me.OpenArgs.
Some time it gives me problem from property palete, so I use on load event on
form.

I hope it would help.

Rashid
 
F

FA

I tried the OpenArgs but it dient work.
In the OpenForm event i have
Me.OpenArgs = Me.SYS_ID_CODE

it didnt work

Please help me.

Moe
 
R

RM Ashraf

Hi

I think u can create the button by using control wizard. It will ask u about
which form u need to call and if there is any filtering criteria. Anyways
following is what it would create for u. u will have to put form fields and
keys.
stDocName = "Finding"
stLinkCriteria = "SYS_ID_CODE = " & Me![SYS_ID_CODE]
DoCmd.OpenForm stDocName, acNormal, , stLinkCriteria, , acDialog,
Me![SYS_ID_CODE]

Now is the Finding form's Load event write something like this:
Me.SYS_ID_CODE.DefaultValue = Me.OpenArgs

I hope this would work.
Rashid
 

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