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

Search all Subform's Combo boxes for a string

294 256MB
Hi all,

I have a Form with the command button 'Submit.' I have a subform inside the form where users are inputting date, company and hours. If they are unsure of the company, they are allowed to enter a value in the combo box of '?????' .. Now, there are going to be multiple records in the subform, some may have '?????' some may not.

I need a MsgBox to pop up, when they click 'Submit' to ensure all Comboboxes with '?????' are changed, this prohibiting them from being submitted.

I have the code:

Expand|Select|Wrap|Line Numbers
  1. If Me!MainForm!ServiceLOBCbx.Text = "?????" Then
  2.     MsgBox ("Enter Correct LOB")
However, it only works if the record is still being edited, not if the user has clicked on a new row.

Is there a way to make the submit button search ALL records in each combobox for that value?

Note: It will always be ????? .. not '?' or '??'

Thanks!!
Sep 27 '13 #1

✓ answered by zmbd

You don't need the "?????" in the field at all; leave the field as an empty value.

In the code for your submit control, open a record set on the holding table that pulls only those records with the Null/Empty field - the SQL would look something like
Expand|Select|Wrap|Line Numbers
  1. SELECT tbl_example.[PK], tbl_example.[needdata]
  2. FROM tbl_example
  3. WHERE (((tbl_example.[needdata]) Is Null));
  4.  
Check for at least one record in the recordset. If any are found then set your (sub)form's filter to pull up those records with an empty field.

4 1536
jimatqsi
1,271 Expert 1GB
So what's the point of this? " If they are unsure of the company, they are allowed to enter a value in the combo box of '?????' " How does that help them at all if you're just going to reject the entry?

Jim
Sep 27 '13 #2
mcupito
294 256MB
Jim,

If the user is unsure of the correct company at the time, they may keep the records on that form, but not yet submit. The ????? are acting as a place holder until more information becomes available. Once they hit 'Submit', though, there should not be allowed to have any values of '?????' to be submitted.
Sep 30 '13 #3
zmbd
5,501 Expert Mod 4TB
You don't need the "?????" in the field at all; leave the field as an empty value.

In the code for your submit control, open a record set on the holding table that pulls only those records with the Null/Empty field - the SQL would look something like
Expand|Select|Wrap|Line Numbers
  1. SELECT tbl_example.[PK], tbl_example.[needdata]
  2. FROM tbl_example
  3. WHERE (((tbl_example.[needdata]) Is Null));
  4.  
Check for at least one record in the recordset. If any are found then set your (sub)form's filter to pull up those records with an empty field.
Oct 3 '13 #4
mcupito
294 256MB
The '?????' was an end-user specification, I had no say in it. I assigned an ID for the '?????', searched for that value with the StaffID when Submit was clicked, and if the lot was 0, I let them proceed, if not I made them change it.
Oct 3 '13 #5

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

Similar topics

1
by: Anonymous | last post by:
Quick question - I have a form with with many fields on it. I have three combo boxes that are used as search engines (Last Name, City, State). For example, when I open the form, all three search...
1
by: Paolo | last post by:
I would like some help on the use of combo boxes. I have created a form and named it Customers. This form's record source is a table, also named Customer. I would now like to add an unbound combo...
2
by: CSDunn | last post by:
Hello, In an Access 2000 ADP subform, I have a set of two Radio buttons in a single group that are bound to a field called 'Completed'. The Completed field comes from an SQL Server 2000 table, is...
1
by: Jeff Smith | last post by:
Hi This is a repost due to no responses Here's a problem I've encountered with Access 2003 which has got me to redesign how I get the row source in a second combo box using the first combo...
2
by: Damon Cherne | last post by:
Here is my issue. I have created a form called “Search” that has several unbound combo boxes, one for each of the attribute that match a column in the Table . Each combo box has input from a...
7
by: badboybrown | last post by:
I know that this is an age old question and it has been approached a few times, but I've hit a wall and require some help. I have various combo boxes that contain values that are both "current"...
7
by: Ausclad | last post by:
Ok, ill try again..... It seems fairly simple. I have two combo boxes in a datagrid. The datagrid is bound to a a table in a dataset. The two combo boxes are bound to a single data table...
3
by: Phil | last post by:
I've posted this a few times without any luck, hoping for some fresh ideas on this. I'm pretty certain this can be done. I've been using a micrsoft template to create a supplier database called...
2
by: SPOILED36 | last post by:
I am building a database to track attendance. I have one main form with multiple subforms. Within one of the subforms name sfrDailyAttendance, I also have cascading combo boxes (cboCategory and...
8
by: troy_lee | last post by:
I want to look at the values of six combo boxes. If any of the boxes are not null, I want to change the value of a separate text box. How can I look at all of them at once? Thanks in advance. ...
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...
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
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
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.