473,326 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Yes/No Check Box

Is there a way to tell access to open or make visible one of two other
forms/subforms depending upon whether the yes no check box is true or
false.

I have a data entry form that collects data on our opened or closed
positions available for physicians. So depending upon what the answer
is with regard to whether a position is open or closed will depend upon
what other table/form I need to fill out, so how do I tell access to
direct itself to a connected table/form when I select yes or no on the
main/original form?

Oct 24 '06 #1
6 7145
You should be able to set the subform's source object based on value of the
checkbox control.

"JayDawg" <he******@cox.netwrote in message
news:11**********************@f16g2000cwb.googlegr oups.com...
Is there a way to tell access to open or make visible one of two other
forms/subforms depending upon whether the yes no check box is true or
false.

I have a data entry form that collects data on our opened or closed
positions available for physicians. So depending upon what the answer
is with regard to whether a position is open or closed will depend upon
what other table/form I need to fill out, so how do I tell access to
direct itself to a connected table/form when I select yes or no on the
main/original form?

Oct 24 '06 #2

JayDawg wrote:
Is there a way to tell access to open or make visible one of two other
forms/subforms depending upon whether the yes no check box is true or
false.

I have a data entry form that collects data on our opened or closed
positions available for physicians. So depending upon what the answer
is with regard to whether a position is open or closed will depend upon
what other table/form I need to fill out, so how do I tell access to
direct itself to a connected table/form when I select yes or no on the
main/original form?
here's an example.

Private Sub cmdToggleSubformVisible_Click()
Me![Applications].Form.Visible = Not Me![Applications].Form.Visible
End Sub

Applications is the *Sub*form name.
Me is the mainform (since the checkbox is on it already)
If the subform isn't visible, you can't tab to it. (I don't think you
can anyway...) so you would go to the visible subform.

Oct 24 '06 #3
Not sure I understand completely what you mean, i know how to connect a
form and subform through the parent child relationship, but dont know
how to tell it to open or make visible a subform based upon the value
in the parent form.

Wes Peters wrote:
You should be able to set the subform's source object based on value of the
checkbox control.

"JayDawg" <he******@cox.netwrote in message
news:11**********************@f16g2000cwb.googlegr oups.com...
Is there a way to tell access to open or make visible one of two other
forms/subforms depending upon whether the yes no check box is true or
false.

I have a data entry form that collects data on our opened or closed
positions available for physicians. So depending upon what the answer
is with regard to whether a position is open or closed will depend upon
what other table/form I need to fill out, so how do I tell access to
direct itself to a connected table/form when I select yes or no on the
main/original form?
Oct 24 '06 #4
Add some code to the main form's "Current" event and the checkbox's "After
Update" event that sets the subform's SourceObject property:

If checkbox = 0 then Me.subform.SourceObject = "thisform" Else
Me.subform.SourceObject = "thatform"

or something like that.

If the link fields are the same for both subforms then that should be all,
otherwise you'll need to set those properties too.

"JayDawg" <he******@cox.netwrote in message
news:11*********************@m73g2000cwd.googlegro ups.com...
Not sure I understand completely what you mean, i know how to connect a
form and subform through the parent child relationship, but dont know
how to tell it to open or make visible a subform based upon the value
in the parent form.

Wes Peters wrote:
You should be able to set the subform's source object based on value of
the
checkbox control.

"JayDawg" <he******@cox.netwrote in message
news:11**********************@f16g2000cwb.googlegr oups.com...
Is there a way to tell access to open or make visible one of two other
forms/subforms depending upon whether the yes no check box is true or
false.
>
I have a data entry form that collects data on our opened or closed
positions available for physicians. So depending upon what the answer
is with regard to whether a position is open or closed will depend
upon
what other table/form I need to fill out, so how do I tell access to
direct itself to a connected table/form when I select yes or no on the
main/original form?
>

Oct 24 '06 #5
I appreciate your assistance and I am sure you are pointing me in the
right direction, but this didnt work for me, probably because I did
something wrong. I dont know VBA real well, can you send me a little
more step by step directions as to what I am suppossed to do. Where do
I put the code on the details section of the form?

pi********@hotmail.com wrote:
JayDawg wrote:
Is there a way to tell access to open or make visible one of two other
forms/subforms depending upon whether the yes no check box is true or
false.

I have a data entry form that collects data on our opened or closed
positions available for physicians. So depending upon what the answer
is with regard to whether a position is open or closed will depend upon
what other table/form I need to fill out, so how do I tell access to
direct itself to a connected table/form when I select yes or no on the
main/original form?

here's an example.

Private Sub cmdToggleSubformVisible_Click()
Me![Applications].Form.Visible = Not Me![Applications].Form.Visible
End Sub

Applications is the *Sub*form name.
Me is the mainform (since the checkbox is on it already)
If the subform isn't visible, you can't tab to it. (I don't think you
can anyway...) so you would go to the visible subform.
Oct 24 '06 #6

JayDawg wrote:
I appreciate your assistance and I am sure you are pointing me in the
right direction, but this didnt work for me, probably because I did
something wrong. I dont know VBA real well, can you send me a little
more step by step directions as to what I am suppossed to do. Where do
I put the code on the details section of the form?
Try this one...

Private Sub chkShowSubform_Click()
Me![SuppliesNeed].Form.Visible = Me.chkShowSubform
End Sub

I have the checkbox "chkShowSubform" on my main form.
The subform is called "SuppliesNeed".
"Me" refers to the form the checkbox is on. (the main form)

So, the ShowSubform stuff is...
MainformName![SubformName].Form
Visible is a property of the subform.
I'm just setting the value of it to the value of the checkbox on the
main form, (in VB shorthand, "Me")

If you want the visible property of the subform to change depending on
the value of the current record, you have to force the Visible property
to be reevaluated in the Current event of the form.

So in the Current event of the Main form, put this code:

Me![SuppliesNeed].Form.Visible = Me.chkShowSubform

(yes, it's the same code as for the checkbox.)

test it out... does it work now?

Oct 24 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Craig Bailey | last post by:
Someone please explain what alternate universe I fell into this afternoon when PHP started telling me that 2 doesn't equal 2. Not sure about you, but when I run this, it tells me 59001.31 doesn't...
2
by: Askari | last post by:
Hi, How do for do a "select()" on a CheckButton in a menu (make with add_checkbutton(....) )? I can modify title, state, etc but not the "check state". :-( Askari
2
by: Edward | last post by:
The following html / javascript code produces a simple form with check boxes. There is also a checkbox that 'checks all' form checkboxes hotmail style: <html> <head> <title></title> </head>...
7
by: Tony Johnson | last post by:
Can you make a check box very big? It seems like when you drag it bigger the little check is still the same size. Thank you, *** Sent via Developersdex http://www.developersdex.com ***...
2
by: Travis.Box | last post by:
I have an MS Access userform with 16 Check Boxes. Each of the checkboxes has a different option value, which coincides with the Check Box name (eg. cb01.OptionValue = 1). At the bottom of the...
1
by: scprosportsman | last post by:
Please help guys, i am trying to set up a database here at work and im fairly new to access in terms of writing functions and queries and stuff. I have 2 different places on my design that will...
2
by: Chris Davoli | last post by:
How do you enable a check box in the GridView. I selected Checkbox Field in the Columns of the GridView, and the check box shows up in the Grid view, but it is disabled. How do I enable it so I can...
16
by: Brian Tkatch | last post by:
Is there a way to check the order in which SET INTEGRITY needs to be applied? This would be for a script with a dynamic list of TABLEs. B.
5
by: starke1120 | last post by:
Im creating a check in – check out database for RF guns. I have a table that contains models. ID (primary key) Model A table that contains Gun Details ID (primary key) Model_id...
1
by: ghjk | last post by:
my php page has 7 check boxes. I stored checked values to database and retrive as binary values. This is the result array Array ( => 0 => 1 => 0 => 1 => 0 => 0 => 1 ) 1 means checked....
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.