J
Jaybird
If I want to make a the value of a textbox dependent upon the selection of a
combobox on the same record of a continuous form, what is the proper event to
fire this so that the records remain independent of one another. Everything
I've tried so far changes more than one record. Here's an example of the
code I'm using:
Private Sub Form_Current()
On Error Resume Next
If IsNull([KEYNUM]) Then Exit Sub
If [KEYNUM] = "CERT" Then [ACCTLAB] = "AL"
[ACCTPRE] = 3052
Me.LINETOTL = 10
If [KEYNUM] = "LINEITEM" Then [ACCTLAB] = "AL"
[ACCTPRE] = 3052
Me.LINETOTL = Forms.frmInvoice.sbfInvoice.Form.txtTtlChrgs
End Sub
I have a tendency to be unclear about what I'm asking, so please let me know
if you need more detail. I can't tell if my if/then structure is to blame,
if I'm trying to use the wrong event, or if my form isn't refreshing
properly. I've tried firing this up in the After Update event of my combobox
and the Before Update event of my textbox, but I can't seem to get it right.
It's funny, because the textboxes [ACCTLAB], and [ACCTPRE] update just fine
depending on the value of the combobox. But the value of [LINETOTL] tends to
be "sticky". That is, it stays in the textbox even when the value of the
combobox [KEYNUM] changes and is requeried and/or refreshed. I think this is
because it has already been passed on to the underlying table and my changes
do not overwrite it. Please give me a clue!
combobox on the same record of a continuous form, what is the proper event to
fire this so that the records remain independent of one another. Everything
I've tried so far changes more than one record. Here's an example of the
code I'm using:
Private Sub Form_Current()
On Error Resume Next
If IsNull([KEYNUM]) Then Exit Sub
If [KEYNUM] = "CERT" Then [ACCTLAB] = "AL"
[ACCTPRE] = 3052
Me.LINETOTL = 10
If [KEYNUM] = "LINEITEM" Then [ACCTLAB] = "AL"
[ACCTPRE] = 3052
Me.LINETOTL = Forms.frmInvoice.sbfInvoice.Form.txtTtlChrgs
End Sub
I have a tendency to be unclear about what I'm asking, so please let me know
if you need more detail. I can't tell if my if/then structure is to blame,
if I'm trying to use the wrong event, or if my form isn't refreshing
properly. I've tried firing this up in the After Update event of my combobox
and the Before Update event of my textbox, but I can't seem to get it right.
It's funny, because the textboxes [ACCTLAB], and [ACCTPRE] update just fine
depending on the value of the combobox. But the value of [LINETOTL] tends to
be "sticky". That is, it stays in the textbox even when the value of the
combobox [KEYNUM] changes and is requeried and/or refreshed. I think this is
because it has already been passed on to the underlying table and my changes
do not overwrite it. Please give me a clue!