Wow, that really looks good!
One question, where you have the strSQL = "SELECT ....etc. -- as you mentioned you shortened the names. I have no control over the table names and field names. Should I change those back to the orginal lengthy monsters or does this work just like it is?
Oh...
Thanks -- I really didn't know what it all meant.
Anyway, I've changed my code as you suggested. I'm still getting the same error.
"A RunSQL actions requires an argument consisting of an SQL statement."
I cannot understand this. It appears to me that the argument is there. My exact...
Oh, I see what you mean.
This code is higher up in the sub. It captures results from combo boxes on the form -- and I thought it was putting them into the "where".
Dim strWhere As String 'String variable to store where clause
If Len(Me.cboIncome & "") > 0 Then...
Thanks Cajun,
I don't know what is incomplete in the Where clause.
The Where clause is commented out in the OpenForm statement. It worked well there as a filter, but I really need it saved as criteria in a query.
I changed it a little. I did
DoCmd.RunSQL "I put the SQL statement here...
OK, I got all that -- thank you very much.
I'm getting another error now.
"A RunSQL actions requires an argument consisting of an SQL statement."
Here's what the code looks like now.....
Dim strSQL As String
Dim stDocName As String
stDocName = strSQL
strSQL =...
I'm sure the concept is valid. I'm trying to pass the results of multiple combo boxes to a SQL string to be used in a query. Here's what I have so far. The message I get is "can't find the object 'stDocName'"
There may be issues beyond this. But I haven't gotten past this error...
This is what I have so far (in the unload event). My problem is the saveasquery command prompts for a filename and I can't figure out how or where to put the text and click the OK button. It will also prompt me that the file already exists and do I want to save anyway.
Also I'm not sure of how...
I'm trying to make it easy for a user to select all in a listbox.
This code works great for clearing all selections (lboTPromoID.Selected(varItem) = False). Why doesn't it work to select all when (varItem) = True?
Also, how can I accomplish my goal here?
Private Sub cmdSelectAll_Click()
On...
Oh yes, thank you. I was missing the vbCritical part and the exit sub part and it just kept running the text export even when I clicked cancel. It works great now. I even added a docmd.cancelevent to it to make it return to the previous state.
Thanks so much.
Melanie
Okay, I've tried several different approaches. I tried to execute a keyboard command to stop the save. I tried an error routine to just get out. And I tried to jump forward in the code. I've have come up with a big 0 on getting anything to work. I'm sure this is due to my inexperience with VB...
A star for you and thanks very much for that explanation info.
I have another short question.
Are there properties for InputBox to be able to control what happens if the user clicks the cancel button or the close control button? I'd like to cancel the unload event in either of these cases...
I'm attempting to give users the opportunity to specify the file name for a text export. I've put the code on the unload event of a form. Ideally, when the user clicks the "close" button, they are promted as to whether they want to export to a text file. If they select yes, then they...
Wow it works. Thank you so much. I've been working on this for days and have tried too many different approaches to mention.
Now to modify it for my other queries. More fun... I'll have to learn a little bit more about what it is doing. But for now I'm happy to have this part of it working...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.