SachAccess
Active member
- Local time
- Tomorrow, 02:06
- Joined
- Nov 22, 2021
- Messages
- 391
Hi,
I am very much new to MS Access, kindly pardon me if am asking silly questions.
Am getting below error on one of the FORM.
Run-time error ‘3075’
Syntax error (missing operator) in query expression
‘Tbl_Cluster_Head. Cluster_Head_ID=’
Can anyone please help me with this, what should I check in the code to resolve the issue. Thanks.
I am very much new to MS Access, kindly pardon me if am asking silly questions.
Am getting below error on one of the FORM.
Run-time error ‘3075’
Syntax error (missing operator) in query expression
‘Tbl_Cluster_Head. Cluster_Head_ID=’
Can anyone please help me with this, what should I check in the code to resolve the issue. Thanks.
Code:
Option Compare Database
Private Sub btn_Options_Click()
Dim DB As Database
Dim strSQL As String
Dim rs As Recordset
Dim lNum As Long
'CurrentDb = Current Databse
'Tbl_Cluster_Head = Table name
Set DB = CurrentDb
'Cluster_Head_ID = Column name from 'Tbl_Cluster_Head' table
strSQL = "Select * from Tbl_Cluster_Head where Tbl_Cluster_Head.Cluster_Head_ID=" & Trim(Me.txt_Cluster_Head_ID.Value) & ";"
Set rs = DB.OpenRecordset(strSQL, dbOpenDynaset)
DoCmd.OpenForm ("Frm_ClusterHeadNew")
'txt_Cluster_Head_ID = TextBox
'txt_Cluster_Head_Name = TextBox
Form_Frm_ClusterHeadNew.txt_ClusterHeadID.Value = Me.txt_Cluster_Head_ID.Value
Form_Frm_ClusterHeadNew.txt_ClusterHeadName.Value = Me.txt_Cluster_Head_Name.Value
End Sub