HillTJ
To train a dog, first know more than the dog..
- Local time
- Yesterday, 12:45
- Joined
- Apr 1, 2019
- Messages
- 731
Hi, I've done the tutorial kindly & thoroughly covered by Uncle Gizmo on his website dealing with the set up of checklists. I'm a bit 'green'with VBA so I don't understand a lot!. I'm hoping that someone familiar with this code can help. I do not wish to post the full code as I think it is Uncle Gizmos intention for me to learn the code myself rather than simply copy & paste exercise. I respect that.
I have 2 problems;
1) I've copied this to a standard module;
I get a compile error at me.Name!! Why?
2) I dont't understand strSQL3 of the following module;
Surely, this should be a variable? I put a 1 in it to test but I think should be a variable.
3) in the tutorial the "code" to fill the subforms was called from the "Current" event but in a later tutorial the code was called from the "on Load" event. What do I do?
I have 2 problems;
1) I've copied this to a standard module;
Code:
Option Compare Database
Option Explicit
Private Function fcopyListToData(lngMasterID As Long)
On Error GoTo Error_Handler
Dim strSubName As String
Dim strModuleName As String
Dim curDB As DAO.Database
Dim rsList As DAO.Recordset
strSubName = "FcopyListToData"
strModuleName = "Form - " & Me.Name
Set curDB = CurrentDb
Dim lngSet As Long
Dim lngID As Long
Set rsList = curDB.OpenRecordset(fSQL_List, dbOpenForwardOnly)
Do Until rsList.EOF
lngSet = rsList!listSets
lngID = rsList!ListID
Call fAppendListToData(lngMasterID, lngSet, lngID)
rsList.MoveNext
Loop
Exit_ErrorHandler:
Exit Function
Error_Handler:
'
Resume Exit_ErrorHandler
End Function
2) I dont't understand strSQL3 of the following module;
Code:
Private Function fSQL_Data(lngMasterID As Long) As String
On Error GoTo Error_Handler
Dim strSQL0 As String
Dim strSQL1 As String
Dim strSQL2 As String
Dim strSQL3 As String
Dim strSQL4 As String
strSQL1 = "SELECT datalinkID,datasets,dataItems,DataTickedOff "
strSQL2 = "FROM tblData "
strSQL3 = "Where (((datalinkID)=1" ' this is used for 1 only....I think this is an error.
strSQL4 = "));"
strSQL0 = strSQL1 & strSQL2 & strSQL3 & strSQL4
fSQL_Data = strSQL0
'Debug.Print fSQL_Data
Exit_ErrorHandler:
Exit Function
Error_Handler:
'
Resume Exit_ErrorHandler
End Function
3) in the tutorial the "code" to fill the subforms was called from the "Current" event but in a later tutorial the code was called from the "on Load" event. What do I do?
Last edited by a moderator: