L
ladybug via AccessMonster.com
I have a form called frm_create_parent. On this form there is a subform
called sfrm_tbl_detail_parent. The record source for sfrm_tbl_detail_parent
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;
I have created a button on sfrm_tbl_detail_parent called btn_gen_stc. The
purpose of the button is to create the stc_no in the subform. When clicked,
I want the next highest stc_no from tbl_detail to appear. Currently there
are over 100 records in tbl_detail. The highest # for stc_no in the table is
9448. I want to be able to click the button and right now 9449 appear. Next
time 9450 and so on.
I have the following code in the On Click Event for 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
However, nothing happens. Can someone please help? Thank you!
called sfrm_tbl_detail_parent. The record source for sfrm_tbl_detail_parent
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;
I have created a button on sfrm_tbl_detail_parent called btn_gen_stc. The
purpose of the button is to create the stc_no in the subform. When clicked,
I want the next highest stc_no from tbl_detail to appear. Currently there
are over 100 records in tbl_detail. The highest # for stc_no in the table is
9448. I want to be able to click the button and right now 9449 appear. Next
time 9450 and so on.
I have the following code in the On Click Event for 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
However, nothing happens. Can someone please help? Thank you!