I have a command button that when clicked is supposed to take me to a new form, start a new record, then change the size of a field and set the focus on this field.
Problem is, the form opens but then I get an error saying "Object Required" and the debug points to the "DateCreatedBy.Left = 4.125 * 1440" string of the code. I have a command button within this form that changes the field size using the same code and it works fine.
Does it still think I am on the first form and that is why I get the "Object Required" error. If so, how do I switch the focus to the new form so that it can find the object?
Thanks in advance.
Private Sub APNEW_Click()
Dim stDocName As String
stDocName = "AdoptiveParent"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Maximize
DoCmd.GoToRecord , , acNewRec
DateCreatedBy.Left = 4.125 * 1440
DateCreatedBy.Top = 0.3333 * 1440
DateCreatedBy.Width = 0.75 * 1440
DateCreatedBy.Height = 0.2083 * 1440
End Sub
Problem is, the form opens but then I get an error saying "Object Required" and the debug points to the "DateCreatedBy.Left = 4.125 * 1440" string of the code. I have a command button within this form that changes the field size using the same code and it works fine.
Does it still think I am on the first form and that is why I get the "Object Required" error. If so, how do I switch the focus to the new form so that it can find the object?
Thanks in advance.
Private Sub APNEW_Click()
Dim stDocName As String
stDocName = "AdoptiveParent"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Maximize
DoCmd.GoToRecord , , acNewRec
DateCreatedBy.Left = 4.125 * 1440
DateCreatedBy.Top = 0.3333 * 1440
DateCreatedBy.Width = 0.75 * 1440
DateCreatedBy.Height = 0.2083 * 1440
End Sub