Dim ctl as Control
For Each ctl In Me.Controls
If TypeOf ctl Is TextBox Then
ctl.Locked = False
ctl.Enabled = True
End If
Next ctl
This code will unlock and enable all text boxes on a VB6 form.
Add an else to your If statement...
If IsNull(Me.Quantity) Then
MsgBox "You must enter a Quantity, it is a required field."
DoCmd.GoToControl "Quantity"
Cancel = True
Else
Exit Sub
'or
'End
End If
I use a table called tblAccessLog.
Fields: UserID, LoginDateTime
When the user submit their password to login, a record is written to this table using Now() for DateTime and UserID from my Login form for UserID.
It may not appear as MISSING:. I've had trouble with DAO with Date() and Format() and, after checking my references, it did not list ANY as MISSING:. However, when I re-established the link to DAO, all was well.
Sorry I couldn't help.
In your module, create a public sub procedure...
Public Sub DisplayForm(FormName As String, Today As Date)
MsgBox "Form Name: " & FormName & vbCrLf & vbCrLf & "Today's Date: " & Today
End Sub
In the OnOpen event of each form, place the following code...
Call DisplayForm(Me.Name, Date)
You need to place single quotes around the criteria...
rstItems.FindFirst "Project_Number = '" & [Forms]![Homepage]![Project_Number] & "'"
[This message has been edited by scottfarcus (edited 06-06-2002).]
Go to any code module.
Click Tools>>References.
Uncheck Microsoft DAO ...
Close the references dialog.
Click Tools>>References.
Find and check Microsoft DAO ...
Open Form1 (the highest level form).
Go to the database window.
Go to design view of any query (or make a new one).
Click in any column of the query grid.
Click the BUILD button on the toolbar. The one with the wand on it.
In the left-hand panel, expand forms.
Expand Loaded Forms.
Expand...
Forms![Form1]![Form2].Form![Form3].Form![FName]
References the FName field on Form3 which is a sub form on Form2 which is a sub form on Form1.
Replace the form names and the field name and it should work for you.
Go into the code block for the command button.
Go to Tools-References.
Check the box next to the Microsoft Excel Object Library (10 for XP).
Enter the following code into the on click event for the command button:
Private Sub Command8_Click()
On Error GoTo Err_Command8_Click
Dim xlsApp As...