![]() “That name already exists in the employee table.” ![]() Me.Emp_Name & “‘”), “zzzz”) “zzzz” Then MsgBox & _ If Nz(DLookup(“Emp_Name”, “Employees”, “Emp_Name='” & _ This example demonstrates a highly compressed method of programming, which I hope you would never use (we don’t). Msgbox “Warning: The date received is more than 30 days ” & _ģ) Validate data exists in a table. If datediff(‘d’, Me.Date_Received,Me.Date_Entered) > 30 then Me.Date_tfocus ‘ set cursor back in the date fieldĢ) Perform data validation on the difference between two date fields is greater than 30 days. Msgbox “Please enter a date less than or equal to today’s date.” ![]() If Me.Date_Entered>date() then ‘ Date_Entered is form field name ![]() Form Data Validation VBA – Data Validation Examplesĭata Validation: The following Microsoft Access Visual Basic code demonstrates several different forms of field validation.1) Checking if the date entered is after today’s date:
0 Comments
Leave a Reply. |