If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
how do i open a subform based on a yes entry in a field in main fo
I am a new user. I have a yes/no field in a main form/table and I want a
subform to open if 'yes' is clicked on the mainform. Can someone help? |
#2
|
|||
|
|||
how do i open a subform based on a yes entry in a field in main fo
You would need to go into the properties of the checkbox, go to events, go to
the onclick event, click the little button out to the right and start the code builder. When the code builder comes up, you would need to type Docmd.openform, "yourformname" and then follow the options. -- Milton Purdy ACCESS State of Arkansas "banbloom" wrote: I am a new user. I have a yes/no field in a main form/table and I want a subform to open if 'yes' is clicked on the mainform. Can someone help? |
#3
|
|||
|
|||
how do i open a subform based on a yes entry in a field in main fo
banbloom,
Let's say the checkbox control on your form is named... chkOne, and it is a boolean field, as you say. And, your subform name is... frmCheckOneSub If you use the form Open command, the subform will open in it's own window, which is not what you want. We'll use the Visible = True/False property instead. Make the subform Visible property = to False as the design default. In design mode, and viewing the Properties dialog box, and having chkOne selected... Locate the AfterUpdate event for chkOne. Place your cursor in the blank text control. Using the little arrow on the right, select Event Procedure from the drop down. Click the little button on the right with 3 dots (...) You are now in the form's Module, where VB code can be placed. You'll see this... Private Sub chkOne_AfterUpdate() End Sub Enter this text between the 2 lines... Private Sub chkOne_AfterUpdate() If Check1 = True Then frmCheckOneSub.Visible = True Else frmCheckOneSub.Visible = False End If End Sub *** OR *** Private Sub chkOne_AfterUpdate() frmCheckOneSub.Visible = chkOne = True End Sub Either coding will show/hide the subform accordingly. -- hth Al Campagna Microsoft Access MVP http://home.comcast.net/~cccsolutions/index.html "Find a job that you love... and you'll never work a day in your life." "banbloom" wrote in message ... I am a new user. I have a yes/no field in a main form/table and I want a subform to open if 'yes' is clicked on the mainform. Can someone help? |
Thread Tools | |
Display Modes | |
|
|