lundi 9 avril 2018

Force user to populate hyperlink prior to populating a text box

I'm currently improving a rather old task order database and one of the feature improvements I'm trying to make is to force the user to set a hyperlink value on a form before picking a date for the task to be marked complete.

I am extremely new to vba, btw.

FEDel is my Text box for the date picker.
FSDel is my Control Source for the date picker.
FDLink is my text box for the hyperlink.
LinkToFieldDel is my Control Source for the hyperlink.

Private Sub FEDel_Click()
  If LinkToFieldDel = Null Then Msgbox("Please set the Field Deliverables File Path before entering a Delivery Date!", vbCritical, "Field Deliverables File Path Not Set!", "Use the 'Link to File Deliverables' button below to set the file path.") As VbMsgBoxResult


  Exit Sub

Else

FileDate.SetFocus
FileDate = Date
Status = "Finished"

End If

End Sub

I keep getting a "Compile Error: Statement invalid outside Type block" on LinkToFieldDel and I'm confused as to why that is.

I'm open to any other suggestions on how to make this type of scenario work as well, this is just what came to mind with my limited experience. Thanks!

Aucun commentaire:

Enregistrer un commentaire