JulianAustin
Programmer
Hi All,
This one has been driving me insane over the past few days. I have searched quite a bit but nothing of concrete leads me to a resolution
I get the Compile Error, expecting Sub, Fucntion or Property. I am relatively new to VBA
I would very much appreciate any help on this.
With thanks.....
Here is my code
Dim dbs As DAO.Database
Dim rst0 As DAO.Recordset
Dim rst2 As DAO.Recordset
Dim Plant1 As String
Dim TotalCOGS As Integer
Dim TotalPlantCOGS As Integer
Dim stDocName As String
DoCmd.SetWarnings False
'DoCmd.SetWarnings True
Plant1 = ""
TotalCOGS = 0
TotalPlantCOGS = 0
'Action First Query
DoCmd.OpenQuery ("MAT COGS - SKU")
Set rst0 = CurrentDb.OpenRecordset("tblMATCOGS-SKU", dbOpenDynaset)
Plant1 = "AU10"
setvalueA (Plant1) <--- I get the error on this.
---Rest of Code....
------ FUNCTION HERE
Option Compare Database
Public strName As String
Public strnameA As String
Public strnameB As String
Function setvalueA(strA As String)
strnameA = strA
End Function
Function SetValueB(strB As String)
strnameB = strB
End Function
Function GetValueA()
GetValueA = strnameA
End Function
Function GetValueB()
GetValueB = strnameB
End Function
This one has been driving me insane over the past few days. I have searched quite a bit but nothing of concrete leads me to a resolution
I get the Compile Error, expecting Sub, Fucntion or Property. I am relatively new to VBA
I would very much appreciate any help on this.
With thanks.....
Here is my code
Dim dbs As DAO.Database
Dim rst0 As DAO.Recordset
Dim rst2 As DAO.Recordset
Dim Plant1 As String
Dim TotalCOGS As Integer
Dim TotalPlantCOGS As Integer
Dim stDocName As String
DoCmd.SetWarnings False
'DoCmd.SetWarnings True
Plant1 = ""
TotalCOGS = 0
TotalPlantCOGS = 0
'Action First Query
DoCmd.OpenQuery ("MAT COGS - SKU")
Set rst0 = CurrentDb.OpenRecordset("tblMATCOGS-SKU", dbOpenDynaset)
Plant1 = "AU10"
setvalueA (Plant1) <--- I get the error on this.
---Rest of Code....
------ FUNCTION HERE
Option Compare Database
Public strName As String
Public strnameA As String
Public strnameB As String
Function setvalueA(strA As String)
strnameA = strA
End Function
Function SetValueB(strB As String)
strnameB = strB
End Function
Function GetValueA()
GetValueA = strnameA
End Function
Function GetValueB()
GetValueB = strnameB
End Function