Okay you VBA experts can probably answer this one in a second and a half.
1)I have a private subroutine that basically takes whatever the user selects in a combo drop down menu and attaches "tbl" + cmbmenuselection. So I have a dropdown menu with "Books", "Trenches", "Dogs". If the user selects "Books" then the sub assigns a variable tblStr to tblBooks. I have another private subroutine that I want that value to go to, how does that work? If I use the variable tblStr does it get recognized? I'm thinking no because in C++/Java, you can only utilize instance or global variables that way.
2) Another question: I have a function SplitString(inString As String) and when I pass in a text box from a form (Me.txtBox) it prompts me to enter a parameter. Here's what I'm trying to use it for. I have a text box in a form and when I enter "dog cat mouse" I want it to process into an SQL statement that reads LIKE dog OR LIKE cat OR LIKE mouse and search for three distinct keywords. The function splitstring does all the formatting for me, but when I try the syntax SplitString(Me.txtBox), it doesn't work, what do I pass in for that? Or do I assign txtBox to a string and then pass that string in?
Sorry if it's a little confusing, but this code's been hammering at my head all day.. I really need to take a VBA class for this hehe. Thanks Tek-Tips people.
1)I have a private subroutine that basically takes whatever the user selects in a combo drop down menu and attaches "tbl" + cmbmenuselection. So I have a dropdown menu with "Books", "Trenches", "Dogs". If the user selects "Books" then the sub assigns a variable tblStr to tblBooks. I have another private subroutine that I want that value to go to, how does that work? If I use the variable tblStr does it get recognized? I'm thinking no because in C++/Java, you can only utilize instance or global variables that way.
2) Another question: I have a function SplitString(inString As String) and when I pass in a text box from a form (Me.txtBox) it prompts me to enter a parameter. Here's what I'm trying to use it for. I have a text box in a form and when I enter "dog cat mouse" I want it to process into an SQL statement that reads LIKE dog OR LIKE cat OR LIKE mouse and search for three distinct keywords. The function splitstring does all the formatting for me, but when I try the syntax SplitString(Me.txtBox), it doesn't work, what do I pass in for that? Or do I assign txtBox to a string and then pass that string in?
Sorry if it's a little confusing, but this code's been hammering at my head all day.. I really need to take a VBA class for this hehe. Thanks Tek-Tips people.