Hi,
I hav this function
public function functionUserLog(byval v_lngHospNo as long , _
byval v_strForm as string, _
byval v_strUser as string, _
byval v_dtDate as date, _
byval v_strDesc as string) as boolean
dim strSql as string
dim lngRecAff as long
dim db as dao.database
strSql = "insert into tblUserLog (Hospital_no, CurrentForm, LoginName, " & _
"DateAdded, DescripWhatsAdd) " & _
"values (" & v_lngHospNo & ", '" & _
v_strForm & "', '" & v_strUser & "', #" & _
v_dtDate & "#, '" & v_strDesc & "')"
set db = currentdb
db.execute strsql
functionUserLog = (db.recordsaffected > 0)
end function
am using this code to execute the function -
strUserName = Environ("username")
functionUserLog(txtWLHospitalNo, "Provisional Waiting List", strUserName, Date, "Funding Approved") As Boolean
and i get compile error saying "statement invalid outside type block"
have i done this write!
I hav this function
public function functionUserLog(byval v_lngHospNo as long , _
byval v_strForm as string, _
byval v_strUser as string, _
byval v_dtDate as date, _
byval v_strDesc as string) as boolean
dim strSql as string
dim lngRecAff as long
dim db as dao.database
strSql = "insert into tblUserLog (Hospital_no, CurrentForm, LoginName, " & _
"DateAdded, DescripWhatsAdd) " & _
"values (" & v_lngHospNo & ", '" & _
v_strForm & "', '" & v_strUser & "', #" & _
v_dtDate & "#, '" & v_strDesc & "')"
set db = currentdb
db.execute strsql
functionUserLog = (db.recordsaffected > 0)
end function
am using this code to execute the function -
strUserName = Environ("username")
functionUserLog(txtWLHospitalNo, "Provisional Waiting List", strUserName, Date, "Funding Approved") As Boolean
and i get compile error saying "statement invalid outside type block"
have i done this write!