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

Search Combobox for String when Button Clicked

294 256MB
I've a Combobox in a subform that will contain values. While entering data on the subform, a value of '?????' is acceptable, however when the 'Submit' button is clicked on the main form, I wish to present MsgBox("Must enter correct info") and make them choose the correct value in the combobox.

I know this can be done in VBA, however I am not sure exactly how to do it.

My best guess was (on click, event procedure) :
If Me.MainForm.SubForm.ComboBox.Text = "?????" Then
MsgBox("Must Enter Correct Information")
End If

But it isn't working.

Thanks.
Sep 13 '13 #1

✓ answered by Seth Schrock

To reference a control on a subform, you do it like this:
Expand|Select|Wrap|Line Numbers
  1. Me.Main_Form_Name.Subform_name.Form.Control_Name
See Referring to items on a subform for more details.

1 1927
Seth Schrock
2,965 Expert 2GB
To reference a control on a subform, you do it like this:
Expand|Select|Wrap|Line Numbers
  1. Me.Main_Form_Name.Subform_name.Form.Control_Name
See Referring to items on a subform for more details.
Sep 13 '13 #2

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

Similar topics

3
by: TJS | last post by:
trying to get 2 scripts to run when a button is clicked. The first is a confirm which should only run the second script if true. the problem is the second script doesn't run when "ok" is selected...
0
by: L Mehl | last post by:
Hello -- My form's cmdCancel button requires 3 clicks before the code in Cancel_Click fires. Each click prior to that success moves the highlight to the next field in the Tab order . I...
6
by: Alan | last post by:
I want to search a string in a file, but I don't know the position, how can I search the string and stop at that line containing that string ? for example, I want to seach the string ".ABC" in a...
2
by: Patrick | last post by:
i have the following .aspx file defined: ..... other tags here ... <asp:TableCell><asp:button id="AddButton" Runat="server" Text="Add New Vessel..."</asp:button></asp:TableCell> ..... other tags...
0
by: ABC | last post by:
How to make change one frame size (width) when I clicked a button on anothoer frame?
1
by: CHNLAKSHMI | last post by:
There are two textboxes and a button. If we click the button,the text must be entered into focused textbox
3
matrekz42
by: matrekz42 | last post by:
This may seem extremely simple, but I want to have in VB a code that will change the width of a TextBox when a button in the form is clicked. How can I go about this?
5
by: Jim in Arizona | last post by:
When placing a link using html, it's easy to have a new window opened for the link instead of redirecting the current page to the destination. IE: <a href="../folder5/anotherpage.aspx"...
1
by: munkee | last post by:
A very simple question which I cant answer myself at the meoment due to epic tiredness. I have a combobox in my access 2003 database which is populated with the real names of users taken from a...
1
by: Claudiu | last post by:
Hi, I have the following code and no matter what I do onclick event for button is not firing. I tried deleting the button, the pages. Redid the code. Moved the web project to a different...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.