Lrn2Code
Registered User.
- Local time
- Today, 16:06
- Joined
- Dec 8, 2008
- Messages
- 56
Hello,
I'm about ready to rip my hair out. I've been trying to run a SQL statement to select all the values on a form where the checkbox value is true. The form is designed to run edit checks on entities (which I'm also having trouble with getting only one entity's records to be reviewed at a time, but that's another hair ripper...).
Anyway, I keep getting an error (3135 syntax error in JOIN operation) in my SQL statement (in blue). The code I'm trying to run follows -
Option Compare Database
Option Explicit
Dim strSQL As String
Dim strSQL1 As String
Dim strSQL2 As String
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim qdf As QueryDef
Private Sub EditCheck_AfterUpdate()
If Me.EditCheck = True Then (This line is running properly)
strSQL = "Select * from (Form_frmDataCheck.(frmMakeFloppySub)) where (Editcheck.Value) = true"
Debug.Print (strSQL)
Set rst = CurrentDb.OpenRecordset(strSQL) (This is the line it blows up on)
If rst.RecordCount > 0 Then
rst.MoveLast
rst.MoveFirst
If rst.RecordCount > 1 Then
MsgBox ("Select only one entity at a time for edit checking.")
If rst.RecordCount = 1 Then
strSQL1 = "Update c_orgs set editcheck = true where orgid = '" & Orgid & "'" (I put this in to update the c_orgs table value with what is on the form)
Debug.Print (strSQL1)
Set qdf = CurrentDb.CreateQueryDef("", strSQL1)
qdf.Execute
End If
End If
End If
End If
I have changed how I reference the form - using (), or "", or the ! between Forms and the form name (I get an error when I do that too) - trying to figure out the proper syntax. I have searched this site multiple times in the past week and either can't find what I'm looking for or don't really know what I'm looking for.
Is there some place that explains the proper syntax for referencing form values?
One other thing - when I check an entity on the form and go to run the edit check I get a write conflict error and can't figure out why. (Being a novice is such a pain.)
Any help/guidance you can provide would be much appreciated.
Thanks for your time.
I'm about ready to rip my hair out. I've been trying to run a SQL statement to select all the values on a form where the checkbox value is true. The form is designed to run edit checks on entities (which I'm also having trouble with getting only one entity's records to be reviewed at a time, but that's another hair ripper...).
Anyway, I keep getting an error (3135 syntax error in JOIN operation) in my SQL statement (in blue). The code I'm trying to run follows -
Option Compare Database
Option Explicit
Dim strSQL As String
Dim strSQL1 As String
Dim strSQL2 As String
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim qdf As QueryDef
Private Sub EditCheck_AfterUpdate()
If Me.EditCheck = True Then (This line is running properly)
strSQL = "Select * from (Form_frmDataCheck.(frmMakeFloppySub)) where (Editcheck.Value) = true"
Debug.Print (strSQL)
Set rst = CurrentDb.OpenRecordset(strSQL) (This is the line it blows up on)
If rst.RecordCount > 0 Then
rst.MoveLast
rst.MoveFirst
If rst.RecordCount > 1 Then
MsgBox ("Select only one entity at a time for edit checking.")
If rst.RecordCount = 1 Then
strSQL1 = "Update c_orgs set editcheck = true where orgid = '" & Orgid & "'" (I put this in to update the c_orgs table value with what is on the form)
Debug.Print (strSQL1)
Set qdf = CurrentDb.CreateQueryDef("", strSQL1)
qdf.Execute
End If
End If
End If
End If
I have changed how I reference the form - using (), or "", or the ! between Forms and the form name (I get an error when I do that too) - trying to figure out the proper syntax. I have searched this site multiple times in the past week and either can't find what I'm looking for or don't really know what I'm looking for.
Is there some place that explains the proper syntax for referencing form values?
One other thing - when I check an entity on the form and go to run the edit check I get a write conflict error and can't figure out why. (Being a novice is such a pain.)
Any help/guidance you can provide would be much appreciated.
Thanks for your time.