Hello,
I have a question on the form property OnGotFocus. I have a Form-A with at command button that opens Form-B (the Form-A remains open). When data entry is complete on Form-B and it is closed, I want Form-A to update based on what was input on Form-B. I have it working if I code something in Form-A’s OnDirty property. However, this requires something else to be changed on Form-A. I tried placing the OnDirty code into the OnGotFocus property but it does not work.
Maybe this isn’t the function of the OnGotFocus property and as such maybe can’t do what I want but was just inquiring as to its possibility. In most instances it’s not a big issue as usually there will be additional input required on Form-A, but I just thought this would be a nicety.
Here's my CODE:
If Me.Grades = -1 Then
If Me.Request_No > 0 Then
Me.txtRequest_No.Visible = True
Me.cmdGrdRequest.Visible = False
Else
Me.txtRequest_No.Visible = False
Me.cmdGrdRequest.Visible = True
End If
Else
If Me.Request_No > 0 Then
Me.txtRequest_No.Visible = True
Me.cmdGrdRequest.Visible = False
Else
Me.txtRequest_No.Visible = False
Me.cmdGrdRequest.Visible = True
End If
Me.cmdGrdRequest.Visible = False
End If
DoCmd.RunCommand acCmdSaveRecord
DoCmd.RepaintObject
Thanks,
SKK
I have a question on the form property OnGotFocus. I have a Form-A with at command button that opens Form-B (the Form-A remains open). When data entry is complete on Form-B and it is closed, I want Form-A to update based on what was input on Form-B. I have it working if I code something in Form-A’s OnDirty property. However, this requires something else to be changed on Form-A. I tried placing the OnDirty code into the OnGotFocus property but it does not work.
Maybe this isn’t the function of the OnGotFocus property and as such maybe can’t do what I want but was just inquiring as to its possibility. In most instances it’s not a big issue as usually there will be additional input required on Form-A, but I just thought this would be a nicety.
Here's my CODE:
If Me.Grades = -1 Then
If Me.Request_No > 0 Then
Me.txtRequest_No.Visible = True
Me.cmdGrdRequest.Visible = False
Else
Me.txtRequest_No.Visible = False
Me.cmdGrdRequest.Visible = True
End If
Else
If Me.Request_No > 0 Then
Me.txtRequest_No.Visible = True
Me.cmdGrdRequest.Visible = False
Else
Me.txtRequest_No.Visible = False
Me.cmdGrdRequest.Visible = True
End If
Me.cmdGrdRequest.Visible = False
End If
DoCmd.RunCommand acCmdSaveRecord
DoCmd.RepaintObject
Thanks,
SKK