Inputting Multiple Values Automatically

  • Thread starter Thread starter VainDM
  • Start date Start date
V

VainDM

Hi,

I have a form entitle 'Job Sheet' and on this form there is the usual data
(customer name; job number; Date) but aswell as these there is also data
regarding the product and each time the job sheet it issued most of these are
the same for the same component;

Component ID; Component Nm; IMP; Cycle Time; Material

is there any way of creating a combo box for the component name which will
then input the rest of the data for me?
 
Use a multi column combo box and make only the Component Nm column visible.
You do that with the Column Widths property by setting the widths for the
columns you don't want to see to 0. It would be something like:

0";1";0";0";0"

Then use the After Update event of the Combo to populate the bound controls
on the form:

With Me
.txtComponentID = .cboComponent.Column(0)
.txtComponentName = .cboComponent.Column(1)
.txtIMP = .cboComponent.Column(2)
.txtCycleTime = .cboComponent.Column(3)
.txtMaterial = .cboComponent.Column(4)
 
First setup the rowsource query of your combo box to contain all of the
fields listed below (I am calling the combobox cboID )
in the format set the column count to 5 to include all of them. Set your
comumn widths to view as you want

After you make a selection in your combo box you can use the column property
to get to any of the columns. The trick is to remember that the first
column start with ZERO

me.cboID or me.cboID.Column(0) will be Component ID
me.cboID.Column(1) will be Component NM
me.cboID.Column(2) will be IMP
me.cboID.Column(3) will be Cycle Time
me.cboID.Column(4) will be Material

so
txtBox1=me.cboID.column(3) will put the Cycle Time in txtBox1


Tom
 
Thanks guys works perfectly now, much easier than having to go back and look
up the details! :o)
 
hi, I have come across a problem with my drop-down list, if I am inputting a
one-off job then the database erases whatever I type, i assume it is because
the record hasn't been on the database before, how do i stop this??
 
hi, I have come across a problem with my drop-down list, if I am inputting a
one-off job then the database erases whatever I type, i assume it is because
the record hasn't been on the database before, how do i stop this??
 
Back
Top