UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Show Id In Combo Box In A Different Form Only If All Controls Are Populated, Access 2016    
 
   
Vector1
post Dec 22 2017, 09:31 AM
Post#1



Posts: 72
Joined: 9-March 17



Hi,
Can someone help in figuring out how to make sure that the ID of a record only shows up in a combo box only if all fields are populated?
Thank you!
Go to the top of the page
 
GroverParkGeorge
post Dec 22 2017, 09:44 AM
Post#2


UA Admin
Posts: 33,034
Joined: 20-June 02
From: Newcastle, WA


Perhaps if we understood WHY this is needed, we'd be able to offer some suggestions on how to approach a solution.

--------------------
Go to the top of the page
 
doctor9
post Dec 22 2017, 09:45 AM
Post#3


UtterAccess Editor
Posts: 18,324
Joined: 29-March 05
From: Wisconsin


Vector1,

Your combobox uses a query to populate the list of choices. Let's say your table has four fields named "FileID", "strPath", "strFilename" and "dteLastModifed". The query could look something like this:

SELECT FileID, strFilename
FROM tblFiles
WHERE strFilename Is Not Null AND strPath Is Not Null AND dteLastModified Is Not Null;

In this example, your query only shows the FileID and the strFilename field, because those are the only ones that are important to make the combobox work. FileID is the primary key that identifies the record, and strFilename is the text that the user sees when making their selection. But the WHERE clause is where you decide what is included in the list. Now, if you have a text field that contains an empty string, that is NOT the same as Null, and you may need to account for that. But this is a good starting point, I think.

Hope this helps,

Dennis

--------------------
(;,;) Li'l Cthulu says: Please talk about what you're trying to do, as well as how you're doing it.
Changing your real table name to "Table1" and your real form name to "Form1" in your posts makes it more difficult to understand what's going on, not easier.
Guidelines for Posting Questions
Go to the top of the page
 
Vector1
post Dec 22 2017, 10:13 AM
Post#4



Posts: 72
Joined: 9-March 17



Thank you Dennis!
Definitely helps. I do have combo box, check box, as well as text fields in the table. Can these field be verified in a query? or I would have to go with VBA of sorts?
Go to the top of the page
 
GroverParkGeorge
post Dec 22 2017, 10:14 AM
Post#5


UA Admin
Posts: 33,034
Joined: 20-June 02
From: Newcastle, WA


Hm. Reading Dennis' response makes me wonder if I'm misreading the topic and question.

Your topic says: "Only If All Controls Are Populated" which I took to mean the controls on the original form are all filled with appropriate values. Dennis is focusing on the row source of the combo box, which might be a different thing.

What are we trying to accomplish here, in plain layperson's terms?

Thanks.

--------------------
Go to the top of the page
 
doctor9
post Dec 22 2017, 10:28 AM
Post#6


UtterAccess Editor
Posts: 18,324
Joined: 29-March 05
From: Wisconsin


Vector1,

At this point I think it's best that you address George's questions. You're talking about things like 'checkboxes' which is a form control, not a field datatype.

What do form controls have to do with what you're asking?

Dennis

--------------------
(;,;) Li'l Cthulu says: Please talk about what you're trying to do, as well as how you're doing it.
Changing your real table name to "Table1" and your real form name to "Form1" in your posts makes it more difficult to understand what's going on, not easier.
Guidelines for Posting Questions
Go to the top of the page
 
Vector1
post Dec 22 2017, 11:11 AM
Post#7



Posts: 72
Joined: 9-March 17



George and Dennis,
I do have a form, which of course pulls fields from a table. Yes, at first I was thinking to validate whether all the controls on a form are populated or not. And I still would like to do that, but my combo box which is suppose to filter out incomplete form IDs is in a different form.

---Background----
We produce a finished good, which has several sub-assemblies. With each sub-assembly we would have a unique ID and when all sub-assemblies are complete than we would put the finish good together.
Now, we may have several of these sub-assemblies made already. Operator may pick randomly from each and put them all together to get a finish good which in turn will get a unique ID.
This finish good unique ID and the sub-assemblies picked by operator are supposed to get tied together in the final form.
-------------------
---Current Situation---
So, my database provides operators shop floor traveler (Job, requirement, measurement, sign, date) for each sub-assembly.

FOR THE FINAL ASSEMBLY I WOULD LIKE TO CREATE A FORM WITH COMBO BOXES TO HAVE ONLY COMPLETED SUB-ASSEMBLIES/SHOP FLOOR TRAVELERS AVAILABLE FOR THE OPERATOR TO PICK FROM AND HAVE THOSE SUB ASSEMBLY IDs tied to the final form ID. (seems backwards, but thats the current logic in the process).
Go to the top of the page
 
doctor9
post Dec 22 2017, 11:18 AM
Post#8


UtterAccess Editor
Posts: 18,324
Joined: 29-March 05
From: Wisconsin


Vector1,

In that case, just remember that forms and form controls are just ways of DISPLAYING data, but tables STORE the data. In particular, if you have a form where the user is filling in details, none of that data will actually show up in the table until the record is saved. This usually happens when the user either closes the form or navigates to a new/different record.

Having said that, if you have a boolean (yes/no) field, it's probably safe to say that you have it set up with a default value of FALSE. In that case, if you only want to list records where the value is TRUE, the WHERE clause would include something like:

boolApprovedByManagement = True

Hope this helps,

Dennis

--------------------
(;,;) Li'l Cthulu says: Please talk about what you're trying to do, as well as how you're doing it.
Changing your real table name to "Table1" and your real form name to "Form1" in your posts makes it more difficult to understand what's going on, not easier.
Guidelines for Posting Questions
Go to the top of the page
 
Vector1
post Dec 22 2017, 11:38 AM
Post#9



Posts: 72
Joined: 9-March 17



Dennis, Thank you for your quick response...
George, Would you like to add something to this conversation, that may help improve functionality or process?

Thank you.
Go to the top of the page
 
GroverParkGeorge
post Dec 22 2017, 01:39 PM
Post#10


UA Admin
Posts: 33,034
Joined: 20-June 02
From: Newcastle, WA


Dennis is doing a great job.

--------------------
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    19th July 2018 - 04:59 AM