Required fields

Tech-Archive recommends: Fix windows errors by optimizing your registry



I am makeing three fields required for the form, Company, State, and Date
Fine Paid. If all three are not blank then the macro is ran, if one or all
of them are blank the user recieves this message: Please Enter Required Field
(Company, State, and Date Fine Paid)!
My problem is VB doesn't like my Date Fine Paid field. I beleive it is
because it has spaces in it. It runs fine I just use company and state, but
gives me an error when I add Date Fine Paid. Compile Error Expected: )
I trided "" like "Date Fine Paid" but that didn't work.
Any ideas?
Thanks

If (Company.Value <> "" And State.Value <> "" And Date Fine Paid.Value
<> "") Then

Dim stDocName As String

stDocName = "New Fine Added"
DoCmd.RunMacro stDocName

Else: MsgBox "Please Enter Required Field (Company, State, and Date Fine
Paid)!"
End If

.



Relevant Pages

  • Re: Macro needed to highlight a row
    ... highlighted when someone enters Paid Off, Missing and Other. ... For starters VBA has 8 shorthand colors ... Copy the macro below into the macropar of the sheet where you want the ...
    (microsoft.public.excel.programming)
  • Re: Required fields
    ... I was using AND because it was running the macro if Company AND State AND ... rather than allenbrowne at mvps dot org. ... >> Fine Paid. ... >> Dim stDocName As String ...
    (microsoft.public.access.formscoding)
  • Re: Macro needed to highlight a row
    ... highlighted when someone enters Paid Off, Missing and Other. ... Copy the macro below into the macropar of the sheet where you want the ...     Select Case Target.Value ...
    (microsoft.public.excel.programming)
  • Re: Macro needed to highlight a row
    ... highlighted when someone enters Paid Off, Missing and Other. ... Copy the macro below into the macropar of the sheet where you want the ...     Select Case Target.Value ...
    (microsoft.public.excel.programming)
  • Re: Macro needed to highlight a row
    ... highlighted when someone enters Paid Off, Missing and Other. ... Copy the macro below into the macropar of the sheet where you want the ...     Select Case Target.Value ...
    (microsoft.public.excel.programming)