B
BigD
Guest
I am pretty new to VBA programming and having problems with the following syntax.
Function CTProvidersB_PopulateRTC()
Set db = CurrentDb()
Set rs = db.OpenRecordSet("CT-Providers")
Set fld1 = rs("Primary_Specialty")
Set fld1 = rs("Secondary_Specialty")
Set fld3 = rs("RTC")
rs.MoveFirst
Do
rs.Edit
If fld1 = "Insurance Medicine" And fld2 = "Occupational Medicine" Then fld3 = "PH"
ElseIf fld1 = "Insurance Medicine" And fld2 = "Psychiatry" Then fld3 = "BP"
rs.Update
rs.MoveNext
Loop Until rs.EOF
MsgBox "Complete.", vbInformation, "MCIS Update"
rs.Close
End Function
Any help would be appreciated.
Function CTProvidersB_PopulateRTC()
Set db = CurrentDb()
Set rs = db.OpenRecordSet("CT-Providers")
Set fld1 = rs("Primary_Specialty")
Set fld1 = rs("Secondary_Specialty")
Set fld3 = rs("RTC")
rs.MoveFirst
Do
rs.Edit
If fld1 = "Insurance Medicine" And fld2 = "Occupational Medicine" Then fld3 = "PH"
ElseIf fld1 = "Insurance Medicine" And fld2 = "Psychiatry" Then fld3 = "BP"
rs.Update
rs.MoveNext
Loop Until rs.EOF
MsgBox "Complete.", vbInformation, "MCIS Update"
rs.Close
End Function
Any help would be appreciated.