2 different forms in a common form

naungsai

Abecedarian
Local time
Today, 18:47
Joined
Sep 8, 2008
Messages
123
Dear friends:o

I am developing a main form with 2 seperate different Subforms.

The common form is handle by Manager, let's call it frm.Manager. In this from.Manager I had put a control (txt.InOut) to put a value in. 2 subforms are form.IN and form.OUT.

If I put in "IN" value in txt.InOut of frm.Manager, I want to display the form.IN and enter data.

If I put in "OUT" value in txt.InOut of frm.Manager, I want to display the form.OUT and enter data.

Help me please.:confused:
 
Try this link http://www.accessdb.info/content/view/112/45/

Editted:
Sorry for the too fast reply....the answer is there

Both of these options are performed in the textbox After Update Event:

Me![In].Form.Visible=True shows the form In
Me![In].Form.Visible=False hides the form In

Or
The Subforms could be Popup Forms:
DoCmd.OpenForm "IN"
 
Last edited:
Thank you for the reply.

One more question! When I navigate the old records, I want to lock the "txt.IorO" field. What code should I put?
 
First, determine what makes a record an old record.

Let's say to determine if an old record is because of some date in a text box, call it txtCompleteDate. If the date in that text box is 7 days ago, then we call that an old record.

So .. on the OnCurrent event of your form you can use ...

Code:
If DateDiff ("d", Now(), Me!txtCompleteDate) > 6 Then
    Me.txt.IorO.Locked = True
End If

-dK
 
Thanks for the concept behind it and the code.
It works!
 

Users who are viewing this thread

Back
Top Bottom