473,405 Members | 2,338 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,405 software developers and data experts.

Error warning for Combo Box if doesn't match Check Box on another Form

I am new to VBA/Microsoft Access. I am trying to get an error message to pop up if someone select "yes" to something but left a check box for the same thing blank in a different form. These forms are connected. One form is identifying information for the patient, and the second one is clinical information. Any suggestions?
Dec 30 '15 #1
3 1059
NeoPa
32,556 Expert Mod 16PB
Hi Kerry. Have you considered removing the option for 'Yes' if the other CheckBox is not selected?

If this is practicable then it would certainly allow for a less clumsy interface. It can be done both ways, of course.

Either approach will require a clear understanding of how all the relevant items relate to each other. I suggest, if you're likely to need help accomplishing this task, that you make those relationships and requirements clear explicitly.
Dec 30 '15 #2
hvsummer
215 128KB
@Kerrymct478: welcome to bytes.com
I am new to VBA/Microsoft Access. I am trying to get an error message to pop up if someone select "yes" to something but left a check box for the same thing blank in a different form. These forms are connected. One form is identifying information for the patient, and the second one is clinical information. Any suggestions?
the first thing I have to tell you that you can't get value represent for "left a check box" from a different form.
When that "different form" closed, everything unload, even controls.value, even these forms are connected, only available when they 're form and subform (open together then that not problem).

to cheat this problem, you can temporary save checkbox.value in a field of tblTemp or in a collection, or even the class module (this method's too complex as we have to code a lot)==

if I was you, I would choose this:

1. bring those form together as form and subform.

2. using vba with collection or tblTemp to temporary save checkbox.value (that could be true or false)
then compare these value have to match (false-false, true-true or it'll msgbox("Error on Checkbox" & i, vbCritical,"Information don't match"))

and as NeoPa said, you should considering disable checkbox when the same checkbox on the innitial form did not check, that'll enable people to see the problem faster and lessen compare/checking handle.
Dec 31 '15 #3
zmbd
5,501 Expert Mod 4TB
Let's see Kerrymct478's reply to Neopa before we start jumping in with suggestions here... this way we have less of a chance of steering K down the wrong path.

HVSummerthe first thing I have to tell you that you can't get value represent for "left a check box" from a different form.
This is only true if the form is closed.
One can certainly reference any value on any open form for any control including those found on subforms.

For example, to reference a textbox on another currently open form one can useForms![openformname]![txtTest].Text

However, what I've found all too often is that there is a fundamental, logical design flaw in the database/interface when this needs to be done.

HVSummer2. using vba with collection or tblTemp to temporary save checkbox.value (that could be true or false)
Due to the inherent bloat in Access, IMHO, Temporary tables in Access should be avoided at all costs or, if needed, used in a temporary back-end database

IN this case, I really do not see the need for the added complication for the temporary table.
One would be much better off using the underlying record-set of the first form to see if the record has been properly set, or the very most, the tempvars.collection if and only if this is the only way - such as with the navigation-control.

I re-iterate: Let's see OP's response to Neopa. He makes a very good suggestion for clearing up the interface, asks for much needed information to steer our new member towards an elegant and efficient solution, and we don't know the nature of the current forms! Additionally, we have no idea of the table structure or even which version of Access/Office OP is using!
Dec 31 '15 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: damatoer | last post by:
I am having problems with attempting to filter a form based on criteria selected in a combo box from another form. I am attempting to have a user select a order number from a combo box that is...
2
by: Bex | last post by:
Hi All. I'm attempting at the moment to set the recordsource of an unbound subform when i open up it's main form. My view is to have one intial form - called "Search" which has a number of...
10
by: lorirobn | last post by:
Hi, I have a form with several combo boxes, continuous form format, with record source a query off an Item Table. The fields are Category, Subcategory, and Color. I am displaying descriptions,...
11
blyxx86
by: blyxx86 | last post by:
I can't seem to get this figured out. I am trying to requery another form after adding new information to a table that a cboList is created from. So, I have a combo box that has Sales personnel,...
5
by: wassimdaccache | last post by:
Hello everybody I'm using access 2003 Sometimes I use to open more than form in my project what I need is to check another form if still opened For example I have : form name X,Y,Z
4
WyvsEyeView
by: WyvsEyeView | last post by:
I am doing the very standard thing of filtering the contents of one combo box based on another combo box. I've done it many times, but always on a main form. Now I'm trying to do it on a datasheet...
6
by: intergnat1 | last post by:
Hi All, My knowledge of VBA and Access 2003 is fairly limited so please bear with me: I am creating a repair invoice database with a form that I will use to record cameras taken in and...
2
by: Rob Dunkley | last post by:
i get the error "An object reference is required for the non-static field, method, or property" when i try to use form2.textbox1.text i have two forms main and advanced. in advanced there is...
11
by: mindbenderz | last post by:
I found this thread and its close to what I need (http://bytes.com/topic/access/answers/208888-open-form-based-field-entry) but doesnt completely answer my issue. I have a field on a form...
1
by: ken90004 | last post by:
I have this small database I am converting from A97 to A2010. I created a new A2010 db and pulled over objects I needed. Everything is tested out and working fine. I also added a drop down box...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.