If you are checking to see if your value is in the table after you've updated the value then it will always find it there (the one you just input).
Either change your code to say > 1 or place the code into the BeforeUpdate.
I don't believe the problem is with your function. The problem is more likely with how you call the function.
If you're calling your function like this:
Sub RunFunction()
Import_Reports("Highland Import Specs", "tblMyTable", "c:\windows\desktop\adhocrpts\")
End Sub
You will get the...
The easiest way to figure out what keycode goes with what key is to try the following:
Private Sub Text5_KeyDown(KeyCode As Integer, Shift As Integer)
MsgBox KeyCode
'or Debug.Print KeyCode
End Sub
You should be able post your demo database (as long as it's not too large) by changing the file type to .Zip. As long as the system Thinks it's a .zip file it will accept it to be posted. Just make sure that people know to change the ".zip" to ".MDB" after they download it.
First glance impression.... (so I have no idea if what I'm saying is true) but, shouldn't you have a (.) dot modifier before DoCmd?
With db
.DoCmd.RunMacro ("AUTOEXEC1")
End With
Otherwise the code will assume you're calling the macro from your current database.
Well this may be a little bit extreme... but you could set up a temporary database, create the table inside that database, link to it run your program and then destroy the temp database.
That would solve your problem and not affect the size of your original database.
What line is giving you the "Invalid Outside Proceedure" Problem that you mentioned?
It sounds as if a public proceedure held in a module would work for you but that it needs to be tailored a bit to make it work appropriately.
More information on the code itself would be helpful.
Perhaps just place the information into an array?
Are you saying you have a reason to not create a table using ADO/DOA, fill the table, and then destroy the table when you're code is completed?
It sounds like you just need to set up your main subroutine to accept a variable and then have your buttons pass their variables to it:
Private Sub Button70_Click()
myProc 70
End Sub
Sub myProc(lngNum as Long)
matchRecord = "SELECT * FROM Matches " _
& " WHERE weightClass = " & lngNum & "...
This depends on what you mean by: No user intervention
It also depends on which OnUpdate your talking about.
If what your saying is that you have code in your second Form's OnUpdate that you want to be called by your first form then you could do one of two things:
1. Remove the Private...
The "wd" words are Constants. Make sure you have a reference to Microsoft Word set.
Tools-> References -> Microsoft Word X.0 Object Library
Otherwise just figure out what the Constant is equal to in Word and switch it out in Access (you can do this by typing Debug.Print wdConstant in the...
Ok... threw me for a loop there for a second...
Take the calls to your form's text boxes out of the quotes:
strSQL = "SELECT Count(InputID) AS TotDays FROM tblInput "
strSQL = strSQL & "WHERE ((([tblInput]![InputDate] Between #"
strSQL = strSQL & [forms]![frmChoose]![StartingDate]
strSQL =...
To help you out in the future: it's always easiest to build your query in query design mode and then convert the SQL to your code. That way you don't have to mess with trying to figure out the parenthesis.