Looping through Combo boxes (1 Viewer)

gsrajan

Registered User.
Local time
Today, 14:11
Joined
Apr 22, 2014
Messages
227
I have 6 combo boxes (Combo1, combo2 etc.,) in my form. Some have value "Completed" and others have "Incomplete"

I wish to loop through these combo boxes and trigger an email for the Incomplete ones.

Please let me know how to do this.

Thanks.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 11:11
Joined
Oct 29, 2018
Messages
21,454
Hi. Are these bound or unbound controls? If bound, you can also just check the record in the table, maybe by using a query.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 11:11
Joined
Aug 30, 2003
Messages
36,124
Sounds like a design issue, but:

Code:
For x = 1 To 6
  If Me("Combo" & x) = "Incomplete" Then
    Do your thing
  End If
Next x
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 19:11
Joined
Jul 9, 2003
Messages
16,272
I have 6 combo boxes (Combo1, combo2 etc.,) in my form. Some have value "Completed" and others have "Incomplete"



I wish to loop through these combo boxes and trigger an email for the Incomplete ones.



Please let me know how to do this.



Thanks.
What do the emails look like?

Sent from Newbury UK
 

gsrajan

Registered User.
Local time
Today, 14:11
Joined
Apr 22, 2014
Messages
227
It looks like a generic email stating the pending actions to be completed. If it is incomplete, an email is sent to the client, fetching the email from the email field in the underlying table. Thanks. I would appreciate if I can get the complete code. Thanks.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 11:11
Joined
Oct 29, 2018
Messages
21,454
It looks like a generic email stating the pending actions to be completed. If it is incomplete, an email is sent to the client, fetching the email from the email field in the underlying table. Thanks. I would appreciate if I can get the complete code. Thanks.
Hi. Without knowing anything about your database structure, it would be kind of hard to give you a "complete" working code, I think.
 

gsrajan

Registered User.
Local time
Today, 14:11
Joined
Apr 22, 2014
Messages
227
Thank you. It is for a law firm. The firm receives a set of documents from the client. I have a document checklist form which is used to check whether a specific document ( say, marriage certificate), is received or not. The checklist is for around 25 documents to be received from the client. An email is sent to the client for the missing documents and if all the documents are received a confirmation mail is sent to the client.

For the documents received, I have a combo box in the DocCheck form against each document where the user selects "received" or "not received" from the drop down, once done, the user click the command button to send email for the missing document(s) or confirming all the documents are received.

Please let me know if I am not making it clear. Thanks.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 11:11
Joined
Oct 29, 2018
Messages
21,454
Thank you. It is for a law firm. The firm receives a set of documents from the client. I have a document checklist form which is used to check whether a specific document ( say, marriage certificate), is received or not. The checklist is for around 25 documents to be received from the client. An email is sent to the client for the missing documents and if all the documents are received a confirmation mail is sent to the client.

For the documents received, I have a combo box in the DocCheck form against each document where the user selects "received" or "not received" from the drop down, once done, the user click the command button to send email for the missing document(s) or confirming all the documents are received.

Please let me know if I am not making it clear. Thanks.
Hi. Thanks for the additional information. It sounds like you may have a bad table structure design, if each combobox is bound to a separate field in the same table. Are you saying all clients require to submit the same six (6) documents every time? If not, how do you know if they have submitted the document or it's not required?
 

gsrajan

Registered User.
Local time
Today, 14:11
Joined
Apr 22, 2014
Messages
227
All documents are required. Yes, each combo box has data field attached to the underlying table. And also correct me if my table structure is wrong and how it has to be designed. Thanks.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 11:11
Joined
Oct 29, 2018
Messages
21,454
All documents are required. Yes, each combo box has data field attached to the underlying table. And also correct me if my table structure is wrong and how it has to be designed. Thanks.
Hi. Since you haven't posted your actual table structure, I am just going to give it a guess here and say you probably should have something like the following structure.


tblClients
ClientID, pk
etc...


tblRequiredDocs
DocID, pk
etc...


tblClientDocs
ClientDocID, pk
ClientID, fk
DocID, fk
DateReceived


With the above structure, you can simply use an OUTER JOIN query to find out which documents each client is missing.
 

Users who are viewing this thread

Top Bottom