L
laavista
I have read through all the threads on this subject and have tried different
things for hours now. I really need help.
Have parent form called: f_credits
Have subform called: f_sf_CreditsUsed
Have field on subform called: CreditsUsed (short integer)
Have cmd button called: cmdDeleteRecord
User clicks on cmd button "cmdDeleteRecord". If there is anything in the
field on the subform (null or > 0), then I want to give user a message that
they cannot delete the credit record until the creditsused they previously
assigned are re-assign. I need to check the CreditsUsed field on the
subform to see if it's null or > 0. Right now, I just need to refer to the
field correctly as the error message I'm getting says that it cannot find the
field I am referring to.
I've tried the following:
===== #1 try ======
If Forms![f_sf_CreditsUsed subform]!CreditsUsed > 0 Then
MsgBox "tell user to reassign creditsused first..."
End If
(also tried if not isnull(...)
===== #2 try ======
Forms!f_Credits!f_sf_CreditsUsed.SetFocus
Forms!f_Credits!f_sf_CreditsUsed!CreditsUsed.SetFocus
If Forms!f_Credits!f_sf_CreditUsed!CreditsUsed > 0 Then
MsgBox "tell user to reassign creditsused first..."
End If
===== #3 try ======
Forms!f_Credits!f_sf_CreditsUsed.SetFocus
Forms!f_Credits!f_sf_CreditsUsed!CreditsUsed.SetFocus
If CreditsUsed > 0 Then
MsgBox "tell user to reassign creditsused first..."
End If
===== #4 try ======
If Me![f_sf_CreditsUsed].Form![CreditsUsed]
....
I've tried a lot more things with no luck.
Your help would be greatly appreciated!
things for hours now. I really need help.
Have parent form called: f_credits
Have subform called: f_sf_CreditsUsed
Have field on subform called: CreditsUsed (short integer)
Have cmd button called: cmdDeleteRecord
User clicks on cmd button "cmdDeleteRecord". If there is anything in the
field on the subform (null or > 0), then I want to give user a message that
they cannot delete the credit record until the creditsused they previously
assigned are re-assign. I need to check the CreditsUsed field on the
subform to see if it's null or > 0. Right now, I just need to refer to the
field correctly as the error message I'm getting says that it cannot find the
field I am referring to.
I've tried the following:
===== #1 try ======
If Forms![f_sf_CreditsUsed subform]!CreditsUsed > 0 Then
MsgBox "tell user to reassign creditsused first..."
End If
(also tried if not isnull(...)
===== #2 try ======
Forms!f_Credits!f_sf_CreditsUsed.SetFocus
Forms!f_Credits!f_sf_CreditsUsed!CreditsUsed.SetFocus
If Forms!f_Credits!f_sf_CreditUsed!CreditsUsed > 0 Then
MsgBox "tell user to reassign creditsused first..."
End If
===== #3 try ======
Forms!f_Credits!f_sf_CreditsUsed.SetFocus
Forms!f_Credits!f_sf_CreditsUsed!CreditsUsed.SetFocus
If CreditsUsed > 0 Then
MsgBox "tell user to reassign creditsused first..."
End If
===== #4 try ======
If Me![f_sf_CreditsUsed].Form![CreditsUsed]
....
I've tried a lot more things with no luck.
Your help would be greatly appreciated!