L
ladybug via AccessMonster.com
I need some assistance with the DMax function. I have a form with a subform.
The record source for the subform is SELECT [tbl_detail].[record_id],
[tbl_detail].[parent_no], [tbl_detail].[stc_no], [tbl_detail].[pz_acct_no],
[tbl_detail].[ctr_nm] FROM tbl_detail;
Now on the subform I have a command button named btn_gen_stc. I want to
click this button and in stc_no I want the next highest # from tbl_detail to
appear in the text box.
I started by putting this in the On Click Event of btn_gen_stc:
Private Sub btn_gen_stc_Click()
If Me.NewRecord Then
Me.stc_no = DMax("stc_no", "tbl_detail") + 1
End If
End Sub
Now this is where I am missing something. There is no # generating in stc_no
on the subform. Can someone help me?
The record source for the subform is SELECT [tbl_detail].[record_id],
[tbl_detail].[parent_no], [tbl_detail].[stc_no], [tbl_detail].[pz_acct_no],
[tbl_detail].[ctr_nm] FROM tbl_detail;
Now on the subform I have a command button named btn_gen_stc. I want to
click this button and in stc_no I want the next highest # from tbl_detail to
appear in the text box.
I started by putting this in the On Click Event of btn_gen_stc:
Private Sub btn_gen_stc_Click()
If Me.NewRecord Then
Me.stc_no = DMax("stc_no", "tbl_detail") + 1
End If
End Sub
Now this is where I am missing something. There is no # generating in stc_no
on the subform. Can someone help me?