tofusunday
New member
- Local time
- Today, 15:15
- Joined
- May 4, 2010
- Messages
- 2
I'm really new to having to do anything in visual basic. But, I have edited some code before that selects certain customers when a button is clicked on and then generates a report.
I don't know exactly how to continue code onto another line, as I reached my maximum length for the first line of customers. I thought I had it figured out, but I was getting a "run time error 7769 the filter would be too long error" after running it.
Here is an example of the code, how do I continue assigning customer names to the button click on another line of code, and is there a string length limit as far as how many customers I can assign to that button click?
Private Sub Command47_Click()
Me!Text2 = "='Cust1' or [CUS_CorpName]='Cust2' or [CUS_CorpName]='Cust3' or [CUS_CorpName]='Cust4' or [CUS_CorpName]='Cust5' "
strCriteria = "[SOD_RequiredDate] Between #" & Me![DTPicker8] & "# And #" & Me![DTPicker9] & "# And [CUS_CorpName]" & Me!Text2
' And [CUS_CorpName] = " & Me!Text2
Thank you in advance for your help!
I don't know exactly how to continue code onto another line, as I reached my maximum length for the first line of customers. I thought I had it figured out, but I was getting a "run time error 7769 the filter would be too long error" after running it.
Here is an example of the code, how do I continue assigning customer names to the button click on another line of code, and is there a string length limit as far as how many customers I can assign to that button click?
Private Sub Command47_Click()
Me!Text2 = "='Cust1' or [CUS_CorpName]='Cust2' or [CUS_CorpName]='Cust3' or [CUS_CorpName]='Cust4' or [CUS_CorpName]='Cust5' "
strCriteria = "[SOD_RequiredDate] Between #" & Me![DTPicker8] & "# And #" & Me![DTPicker9] & "# And [CUS_CorpName]" & Me!Text2
' And [CUS_CorpName] = " & Me!Text2
Thank you in advance for your help!