Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

statement invalid outside type block 1

Status
Not open for further replies.

din2005

Programmer
Mar 22, 2005
162
GB
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!
 
Dim yourBoolean As Boolean
yourBoolean = functionUserLog(txtWLHospitalNo, "Provisional Waiting List", strUserName, Date, "Funding Approved")


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top