M
Midland
I am revisiting a problem with my data entry form, "MachInput" which with the
list helped me a few weeks ago.
I am populating the table "GMachine" with this form, using the Query "InQry"
as a calculating buffer so I can pull reference data on standard rates for
set-up and production.
Previously, I was pulling up rates from "InQry" with this expression:
=IIf([pn]=0,"--",DLookUp("[QStRate]","[InQry]","[RateID]=" &
([pn]+[seq]/1000)))
[pn] is the part number, [seq] is a sub-process, and [QStRate] is a
caculated standard rate from “InQryâ€.
In the older version, each standard rate was designated by a composited ID
number based on the part number and sequence number, i.e. "51204801.010".
Thus, the PN and seq from the form could be used to reference the correct
rate.
For the new system, I need to use a Rate ID that incorporates the Work
Center number, i.e. “4810.51204801.010†or “8250CN.51204801.010â€. I can
create this alpha-numeric designator either within the form or within the
query, using a macro to update the fields while I am working on the record.
The expression used to build the rate ID in the query, using fields from the
data table, is this:
=[wc] & "." & Format([pn],"00000000") & "." & Format([seq],"000"
I therefore can link back to [RateID] in the query record to pull the rate,
or I can build it as a control in the form as [RateIDf]. That led me to
using this variation on the original expression to call up the standard rate:
=IIf([pn]=0,"--",DLookUp("[QStRate]","[InQry]","[RateID]=" &
[MachInput]![RateIDf])
.. . . and I also tried this one:
=IIf([pn]=0,"--",DLookUp("[QStRate]","[InQry]","[RateID]=" & ([wc] & "." &
Format([pn],"00000000") & "." & Format([seq],"000")
Neither of them gives me anything but an error message. When I simplify the
formula to try to read the ID directly, or otherwise experiment, I either get
a message telling me DLookUp cannot find the name, or it asks me to correct
the “number†with the two decimal points in it. It looks as though the
function does not work with an alpha-numeric ID number in a direct way. This
doesn’t seem logical for a data base function, but none of the definitions or
examples I have in my references tell me yea or nay on this point.
I could presumably some other kind of link to pull the ID, but I’m at a loss
as to what would work.
list helped me a few weeks ago.
I am populating the table "GMachine" with this form, using the Query "InQry"
as a calculating buffer so I can pull reference data on standard rates for
set-up and production.
Previously, I was pulling up rates from "InQry" with this expression:
=IIf([pn]=0,"--",DLookUp("[QStRate]","[InQry]","[RateID]=" &
([pn]+[seq]/1000)))
[pn] is the part number, [seq] is a sub-process, and [QStRate] is a
caculated standard rate from “InQryâ€.
In the older version, each standard rate was designated by a composited ID
number based on the part number and sequence number, i.e. "51204801.010".
Thus, the PN and seq from the form could be used to reference the correct
rate.
For the new system, I need to use a Rate ID that incorporates the Work
Center number, i.e. “4810.51204801.010†or “8250CN.51204801.010â€. I can
create this alpha-numeric designator either within the form or within the
query, using a macro to update the fields while I am working on the record.
The expression used to build the rate ID in the query, using fields from the
data table, is this:
=[wc] & "." & Format([pn],"00000000") & "." & Format([seq],"000"
I therefore can link back to [RateID] in the query record to pull the rate,
or I can build it as a control in the form as [RateIDf]. That led me to
using this variation on the original expression to call up the standard rate:
=IIf([pn]=0,"--",DLookUp("[QStRate]","[InQry]","[RateID]=" &
[MachInput]![RateIDf])
.. . . and I also tried this one:
=IIf([pn]=0,"--",DLookUp("[QStRate]","[InQry]","[RateID]=" & ([wc] & "." &
Format([pn],"00000000") & "." & Format([seq],"000")
Neither of them gives me anything but an error message. When I simplify the
formula to try to read the ID directly, or otherwise experiment, I either get
a message telling me DLookUp cannot find the name, or it asks me to correct
the “number†with the two decimal points in it. It looks as though the
function does not work with an alpha-numeric ID number in a direct way. This
doesn’t seem logical for a data base function, but none of the definitions or
examples I have in my references tell me yea or nay on this point.
I could presumably some other kind of link to pull the ID, but I’m at a loss
as to what would work.