Okay give this the once over
Most of your code stays the same
I have removed the line Set qdf = db.QueryDefs("Test")
And I have added the On error line at the top.
Private Sub cmdOK_Click()
On Error GoTo Err_BuildQuery
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim...
My fault.
I have given you code that contains 2 function which both have the same name and it is confusing things somewhat.
Replace the code in the module with this:
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long...
You tell me. In your spec you mention a 'Project Leader'
Does this equate to saying 'Person in charge of module'?
I'll assume that it does.
Board(BoardNumber, BoardName)
Module(ModuleNumber, ModuleName, ModuleLeader, Source, Assembler, Directory)
ModuleParts(Module, Board)
Engineer(EngineerID...
1) When you are in the code window click on the Insert menu at the top and then click Module
2)If you put the code in that I gave you then you have a function called GetUserName.
To call this function you would do something like this
Dim sUserName as String
sUserName = GetUserName
That gives...
instead of merging the tables i think you should split them:
111,EEEE
222,AAAA
333,BBBB
444,CCCC
777,FFFF
444,22000
222,20000
333,10000
111,PRO
222,PRV
777,PSR
Questions:
Can one board be part of more than one module?
Can one engineer be the leader of more than one project?
Can one project contain more than one module?
Can one module be designed by more than one engineer/contractor?
If Yes: Can one board be designed by more than one...
Alrighty, Hows about this for an of the top of my head dirty solution
Make a new Module in your VBA called modGetNames and put this code in it.
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Public Function...
I don't know much about mailmerge.
Are you using a wizard in Word and browsing for the access database and then selecting a a query from a list.
But you cant select the query cos it's run from the VBA and not saved as a query.
Is that where you are at?
You could put an insert query in the IF statement
If Response = vbYes Then
Dim sInsertExercise As String
sInsertExercise = "INSERT INTO tblExercise(ExerciseName) VALUES(""" & Me.Exercise_Name & """);"
CurrentDb.Execute sInsertExercise
Else
You will need to requery...
Forgive me but I am not even going to begin and pick my way through that syntax
If you had a tables set up like this: (I don't know what you are storing so I'll use stupid generic names)
YourTable(YourID, YourFields)
YourRecieved(YourID, RecievedDate)
Then you can query
SELECT YourTable.*...
It's quite alright I used to be the same way. Now I almost sometimes know what I'm doing. ;)
Can I give you a tip.
When you want to do something and you don't know how to do it. After you finally manage to figure it out write down what you wanted to do and how you managed to achive it, cos...
I think this line may be causing you a problem
strFieldList = Left(strCriteria, Len(strCriteria) - 2)
What is strCriteria?
You go to the trouble of looping through the selected items building your strFieldList string.
For Each varItem In Me!lstFieldList.ItemsSelected...
underneath your 'Build Field List comment type Stop
then open your form and test it out.
When it hits the Stop line it will break into the code. now press F8 to move through the code this is a way of seeing exactly what your code is doing and with what.
At any time you are moving through your...