I know this is rather basic, but I am trying to run some VBA Code to do the following:
If X Thenaction 1
action 2
action 3
End If
My issue is that when I run my code it kicks back an error for "End If Without If Block". For the meantime I can throw the If clause in before each action, but ultimately I would like to make this work where there is one If and then multiple subsequent actions. Depite a few hours of googling, I still can't pinpoint my exact problem. Any thoughts on what I may be doing wrong?
The actual line of code I am running is here:
If NLG_UR_AddBasicFacilityInfo = -1 Then _Do Cmd.OpenFor "NLG_Update_Basic_Facility_Info_Table", acFormAdd
[Forms]![NLG_Update_Basic_Facility_Info_Table]![txt_NLG_UBFIR_FacilityID].Value = NLG_UR_FacilityID
[Forms]![NLG_Update_Basic_Facility_Info_Table]![txt_NLG_UBFIR_UpdateDate].Value = NLG_UR_UpdateDate
[Forms]![NLG_Update_Basic_Facility_Info_Table]![hdr_NLG_UBFIR].Value = "Update Basic Facility Info for " _
& NLG_UR_StreetNo & " " & NLG_UR_Predirection & " " & NLG_UR_StreetName & " " & NLG)UR_StreetType & " " & NLG_UR_Unit
End If
I'm building my database on top of Access 2007 at the moment on a Window 7 PC. Please let me know if there is any further info I can provide.
Thanks!