Solved Autofill Only Works for One Text Field

cyliyu

New member
Local time
Today, 10:47
Joined
Jul 27, 2019
Messages
20
I need some help with the following.

1) I have the code included in the Combo box, the Text333 works but not Text373.
Private Sub Combo319_Change() Me.Text333 = Me.Combo319.Column(1) Me.Text373 = Me.Combo319.Column(2) End Sub

2) How do perform the "Frequency Reject" auto calculation when both the "Unit Serial No" AND "Unit Date Code" match? Thanks.
 

Attachments

Last edited:
Need to set combobox properties:

ColumnCount: 3
ColumnWidths: 1";1";1"

Instead of VBA, put expression in textboxes ControlSource property.

=Combo319.Column(1)
=Combo319.Column(2)

What is formula for calculating frequency?
 
Hi. Can't download your file right now. How many columns does your combo have? Did you know Column() starts with zero (0)?
Sent from phone...
 
here and test your testing db.
 

Attachments

Thanks, June7.
The 1st part works.

The formula used in Excel calculation was
=SUMPRODUCT(($J$6:$J$1686=$J1573) * ($K$6:$K$1686 = $K1573)), "")

Where J Column was serial no and K Column was date code

I am not sure how this can be done in Access.
 
That Excel formula means nothing to me. You need to give formula in context of your db structure. Describe what you would do if you calculated with pencil and paper.
 
That Excel formula means nothing to me. You need to give formula in context of your db structure. Describe what you would do if you calculated with pencil and paper.

Basically, the Reject Frequency was to check how many times the equipment has been sent out for repair.
The very first time the data entry for the unit out for repair, it counted as "1", the same unit the next out for repair again, it counted as "2".
The condition was, both the serial number and date code must match. The equipment can have the same serial number but different date code or different serial number but same date code. Thanks.

1589772753553.png
 
This can be done with a DCount() domain aggregate expression in textbox ControlSource:

=DCount("*","tblRPCE","[UnitNo]='" & [UnitNo] & "' AND [UnitDC]='" & [UnitDC] & "'")

This value should not be saved into table. Calculate it when needed.
 
Thanks, June7.

The formula works.
I have removed the field from my table and need to see how to make it real-time update.
 
Record must first be committed to table. Record is committed when: 1) close table/query/form; 2) navigate to another record; 3) code to save
 
Record must first be committed to table. Record is committed when: 1) close table/query/form; 2) navigate to another record; 3) code to save

May need to change the description field to ease to notify the user. Thanks again.
 

Users who are viewing this thread

Back
Top Bottom