A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Complex (for me) custom counter question....



 
 
Thread Tools Display Modes
  #1  
Old August 3rd, 2006, 06:33 PM posted to microsoft.public.access.tablesdbdesign,microsoft.public.access.forms,microsoft.public.access.formscoding
Fletcher
external usenet poster
 
Posts: 46
Default Complex (for me) custom counter question....

Hi, I would like to set up a custom counter for processes in my
facility. I'll list my table structure first, then explain:

*ProcessXData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*ProcessYData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*ProcessZData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*MeasurementsA*
MeasAID, text, PK (linked to DataID)
Top, number
Middle, Number
Bottom, Number

*MeasurementsB*
MeasBID, text, PK (linked to DataID)
MeasData, number
Limit, number

(for simplicity, I lave left out several tables that hold lists of data
that provide information such as operators and specs; I have also
generic-ized the data to make it easier for you, and not disclose any
information that could lead to problems)

So, here's the meat of what I'm having trouble doing. I have 3
different processes and each can have a different spec. For certain
specs on each process, a different measurement is done (MeasurementA or
MeasurementB). I have this worked out on a form where depending on the
spec number that you enter, a different subform for measurments will be
enabled. My dilema is that I can't use autonumber for each process as
an ID, so I would like to creat a custom counter that includes, say,
the abreviation of process name (4 or 5 letters) and a number. I
cannot think of how to do this, so if anyone would be helpful enough to
give me some input, I would appreciate it greatly.

Thanks ahead,
Fletcher...

  #2  
Old August 3rd, 2006, 06:48 PM posted to microsoft.public.access.tablesdbdesign,microsoft.public.access.forms,microsoft.public.access.formscoding
BruceM
external usenet poster
 
Posts: 356
Default Complex (for me) custom counter question....

Is the abbreviation for the process the first five letters of the process
name, or is it derived otherwise? Also, do you want the numbers to start
from one for each process? That is, is the number First001, First002, etc.
and Second001, Second 002, etc., or is it First001, First002, Second003,
Second004, etc.?

"Fletcher" wrote in message
oups.com...
Hi, I would like to set up a custom counter for processes in my
facility. I'll list my table structure first, then explain:

*ProcessXData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*ProcessYData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*ProcessZData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*MeasurementsA*
MeasAID, text, PK (linked to DataID)
Top, number
Middle, Number
Bottom, Number

*MeasurementsB*
MeasBID, text, PK (linked to DataID)
MeasData, number
Limit, number

(for simplicity, I lave left out several tables that hold lists of data
that provide information such as operators and specs; I have also
generic-ized the data to make it easier for you, and not disclose any
information that could lead to problems)

So, here's the meat of what I'm having trouble doing. I have 3
different processes and each can have a different spec. For certain
specs on each process, a different measurement is done (MeasurementA or
MeasurementB). I have this worked out on a form where depending on the
spec number that you enter, a different subform for measurments will be
enabled. My dilema is that I can't use autonumber for each process as
an ID, so I would like to creat a custom counter that includes, say,
the abreviation of process name (4 or 5 letters) and a number. I
cannot think of how to do this, so if anyone would be helpful enough to
give me some input, I would appreciate it greatly.

Thanks ahead,
Fletcher...



  #3  
Old August 3rd, 2006, 06:50 PM posted to microsoft.public.access.tablesdbdesign,microsoft.public.access.forms,microsoft.public.access.formscoding
Jeff L
external usenet poster
 
Posts: 448
Default Complex (for me) custom counter question....

You would need to write some code to make your ID. Access cannot
autogenerate what you are describing. If you are entering data via a
form, you would need something like

Me.DataID = Left(Me.ProcessName,5) & (Dcount("DataID","ProcessXData") +
1)

That is of course assuming you want your numbers to be sequential.

Hope that helps!


Fletcher wrote:
Hi, I would like to set up a custom counter for processes in my
facility. I'll list my table structure first, then explain:

*ProcessXData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*ProcessYData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*ProcessZData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*MeasurementsA*
MeasAID, text, PK (linked to DataID)
Top, number
Middle, Number
Bottom, Number

*MeasurementsB*
MeasBID, text, PK (linked to DataID)
MeasData, number
Limit, number

(for simplicity, I lave left out several tables that hold lists of data
that provide information such as operators and specs; I have also
generic-ized the data to make it easier for you, and not disclose any
information that could lead to problems)

So, here's the meat of what I'm having trouble doing. I have 3
different processes and each can have a different spec. For certain
specs on each process, a different measurement is done (MeasurementA or
MeasurementB). I have this worked out on a form where depending on the
spec number that you enter, a different subform for measurments will be
enabled. My dilema is that I can't use autonumber for each process as
an ID, so I would like to creat a custom counter that includes, say,
the abreviation of process name (4 or 5 letters) and a number. I
cannot think of how to do this, so if anyone would be helpful enough to
give me some input, I would appreciate it greatly.

Thanks ahead,
Fletcher...


  #4  
Old August 3rd, 2006, 07:00 PM posted to microsoft.public.access.tablesdbdesign,microsoft.public.access.forms,microsoft.public.access.formscoding
Fletcher
external usenet poster
 
Posts: 46
Default Complex (for me) custom counter question....

Is the abbreviation for the process the first five letters of the process
name, or is it derived otherwise?

The abbreviation is derived otherwise. I would like to specify it in
the forms code and and have it commented so that later personnel will
know where to change it.

Also, do you want the numbers to start from one for each process?

Yes, I do want them to start from one and be sequential.

Thanks,

Fletcher...

BruceM wrote:
Is the abbreviation for the process the first five letters of the process
name, or is it derived otherwise? Also, do you want the numbers to start
from one for each process? That is, is the number First001, First002, etc.
and Second001, Second 002, etc., or is it First001, First002, Second003,
Second004, etc.?

"Fletcher" wrote in message
oups.com...
Hi, I would like to set up a custom counter for processes in my
facility. I'll list my table structure first, then explain:

*ProcessXData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*ProcessYData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*ProcessZData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*MeasurementsA*
MeasAID, text, PK (linked to DataID)
Top, number
Middle, Number
Bottom, Number

*MeasurementsB*
MeasBID, text, PK (linked to DataID)
MeasData, number
Limit, number

(for simplicity, I lave left out several tables that hold lists of data
that provide information such as operators and specs; I have also
generic-ized the data to make it easier for you, and not disclose any
information that could lead to problems)

So, here's the meat of what I'm having trouble doing. I have 3
different processes and each can have a different spec. For certain
specs on each process, a different measurement is done (MeasurementA or
MeasurementB). I have this worked out on a form where depending on the
spec number that you enter, a different subform for measurments will be
enabled. My dilema is that I can't use autonumber for each process as
an ID, so I would like to creat a custom counter that includes, say,
the abreviation of process name (4 or 5 letters) and a number. I
cannot think of how to do this, so if anyone would be helpful enough to
give me some input, I would appreciate it greatly.

Thanks ahead,
Fletcher...


  #5  
Old August 3rd, 2006, 07:02 PM posted to microsoft.public.access.tablesdbdesign,microsoft.public.access.forms,microsoft.public.access.formscoding
Fletcher
external usenet poster
 
Posts: 46
Default Complex (for me) custom counter question....

Me.DataID = Left(Me.ProcessName,5) & (Dcount("DataID","ProcessXData") +
1)

For this, would the DataID field have to be visible on the form? Or
could it be hidden? Or does it have to be present at all?

I'll experiment with this.

Thanks,
Fletcher...

Jeff L wrote:
You would need to write some code to make your ID. Access cannot
autogenerate what you are describing. If you are entering data via a
form, you would need something like

Me.DataID = Left(Me.ProcessName,5) & (Dcount("DataID","ProcessXData") +
1)

That is of course assuming you want your numbers to be sequential.

Hope that helps!


Fletcher wrote:
Hi, I would like to set up a custom counter for processes in my
facility. I'll list my table structure first, then explain:

*ProcessXData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*ProcessYData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*ProcessZData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*MeasurementsA*
MeasAID, text, PK (linked to DataID)
Top, number
Middle, Number
Bottom, Number

*MeasurementsB*
MeasBID, text, PK (linked to DataID)
MeasData, number
Limit, number

(for simplicity, I lave left out several tables that hold lists of data
that provide information such as operators and specs; I have also
generic-ized the data to make it easier for you, and not disclose any
information that could lead to problems)

So, here's the meat of what I'm having trouble doing. I have 3
different processes and each can have a different spec. For certain
specs on each process, a different measurement is done (MeasurementA or
MeasurementB). I have this worked out on a form where depending on the
spec number that you enter, a different subform for measurments will be
enabled. My dilema is that I can't use autonumber for each process as
an ID, so I would like to creat a custom counter that includes, say,
the abreviation of process name (4 or 5 letters) and a number. I
cannot think of how to do this, so if anyone would be helpful enough to
give me some input, I would appreciate it greatly.

Thanks ahead,
Fletcher...


  #6  
Old August 3rd, 2006, 07:14 PM posted to microsoft.public.access.tablesdbdesign,microsoft.public.access.forms,microsoft.public.access.formscoding
BruceM
external usenet poster
 
Posts: 356
Default Complex (for me) custom counter question....

You're must be specific. How is the abbreviation derived? Knowing that you
want to specify it in the form's code etc. tells me nothing. If later
personnel change it, do you expect the number to start over from 1 with the
new abbreviation, or what? Jeff wrote a suggestion along the lines of what
I would have suggested, except I would have used DMax rather than DCount.

"Fletcher" wrote in message
oups.com...
Is the abbreviation for the process the first five letters of the process
name, or is it derived otherwise?

The abbreviation is derived otherwise. I would like to specify it in
the forms code and and have it commented so that later personnel will
know where to change it.

Also, do you want the numbers to start from one for each process?

Yes, I do want them to start from one and be sequential.

Thanks,

Fletcher...

BruceM wrote:
Is the abbreviation for the process the first five letters of the process
name, or is it derived otherwise? Also, do you want the numbers to start
from one for each process? That is, is the number First001, First002,
etc.
and Second001, Second 002, etc., or is it First001, First002, Second003,
Second004, etc.?

"Fletcher" wrote in message
oups.com...
Hi, I would like to set up a custom counter for processes in my
facility. I'll list my table structure first, then explain:

*ProcessXData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*ProcessYData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*ProcessZData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*MeasurementsA*
MeasAID, text, PK (linked to DataID)
Top, number
Middle, Number
Bottom, Number

*MeasurementsB*
MeasBID, text, PK (linked to DataID)
MeasData, number
Limit, number

(for simplicity, I lave left out several tables that hold lists of data
that provide information such as operators and specs; I have also
generic-ized the data to make it easier for you, and not disclose any
information that could lead to problems)

So, here's the meat of what I'm having trouble doing. I have 3
different processes and each can have a different spec. For certain
specs on each process, a different measurement is done (MeasurementA or
MeasurementB). I have this worked out on a form where depending on the
spec number that you enter, a different subform for measurments will be
enabled. My dilema is that I can't use autonumber for each process as
an ID, so I would like to creat a custom counter that includes, say,
the abreviation of process name (4 or 5 letters) and a number. I
cannot think of how to do this, so if anyone would be helpful enough to
give me some input, I would appreciate it greatly.

Thanks ahead,
Fletcher...




  #7  
Old August 3rd, 2006, 07:22 PM posted to microsoft.public.access.tablesdbdesign,microsoft.public.access.forms,microsoft.public.access.formscoding
Jeff L
external usenet poster
 
Posts: 448
Default Complex (for me) custom counter question....

You would need to have DataID as part of your Record Source, but it
would not have to appear on the form.

  #8  
Old August 3rd, 2006, 07:37 PM posted to microsoft.public.access.tablesdbdesign,microsoft.public.access.forms,microsoft.public.access.formscoding
Fletcher
external usenet poster
 
Posts: 46
Default Complex (for me) custom counter question....

Bruce,
The abbreviation is derived from the Process name. Usually some
combination of letter or words that can identify the process. For
example, we have a Spin Rinse Dryer...we abbreviate that with SRD, or
Boron Diffusion is Bdiff, or Gold Arsenic is Gars...it just depends on
what the process is.

As for starting over at one, it doesn't really matter as long as the
entries in *MeasurementsA* or *MeasurementsB* are related to a given
entry in the *ProcessXData* or *ProcessYData* or *ProcessZData*. We
really only care that a measurment can be attached to a pass through
the machine. Chances are that the engineers won't even see this field.

What is the difference between Dmax and DCount?

Jeff,
I tried your code in Form_Current. I'm having some problems with it
though. Maybe you can help. I put it in very similarly to what you
had (I changed the generic names back to the real names), but I don't
have a Me.ProcessName, so I changed that section to what I wanted it to
be (BDiff, one of the abbr.'s exampled above). The problem is that
first it didn't want to start counting, so I put the first entry in the
table with BDiff1. Then it started counting, but it left off the BDiff
and started putting only numbers in. Any idea how to fix this?

Thanks to you both.

Fletcher...

BruceM wrote:
You're must be specific. How is the abbreviation derived? Knowing that you
want to specify it in the form's code etc. tells me nothing. If later
personnel change it, do you expect the number to start over from 1 with the
new abbreviation, or what? Jeff wrote a suggestion along the lines of what
I would have suggested, except I would have used DMax rather than DCount.

"Fletcher" wrote in message
oups.com...
Is the abbreviation for the process the first five letters of the process
name, or is it derived otherwise?

The abbreviation is derived otherwise. I would like to specify it in
the forms code and and have it commented so that later personnel will
know where to change it.

Also, do you want the numbers to start from one for each process?

Yes, I do want them to start from one and be sequential.

Thanks,

Fletcher...

BruceM wrote:
Is the abbreviation for the process the first five letters of the process
name, or is it derived otherwise? Also, do you want the numbers to start
from one for each process? That is, is the number First001, First002,
etc.
and Second001, Second 002, etc., or is it First001, First002, Second003,
Second004, etc.?

"Fletcher" wrote in message
oups.com...
Hi, I would like to set up a custom counter for processes in my
facility. I'll list my table structure first, then explain:

*ProcessXData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*ProcessYData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*ProcessZData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*MeasurementsA*
MeasAID, text, PK (linked to DataID)
Top, number
Middle, Number
Bottom, Number

*MeasurementsB*
MeasBID, text, PK (linked to DataID)
MeasData, number
Limit, number

(for simplicity, I lave left out several tables that hold lists of data
that provide information such as operators and specs; I have also
generic-ized the data to make it easier for you, and not disclose any
information that could lead to problems)

So, here's the meat of what I'm having trouble doing. I have 3
different processes and each can have a different spec. For certain
specs on each process, a different measurement is done (MeasurementA or
MeasurementB). I have this worked out on a form where depending on the
spec number that you enter, a different subform for measurments will be
enabled. My dilema is that I can't use autonumber for each process as
an ID, so I would like to creat a custom counter that includes, say,
the abreviation of process name (4 or 5 letters) and a number. I
cannot think of how to do this, so if anyone would be helpful enough to
give me some input, I would appreciate it greatly.

Thanks ahead,
Fletcher...



  #9  
Old August 3rd, 2006, 08:37 PM posted to microsoft.public.access.tablesdbdesign,microsoft.public.access.forms,microsoft.public.access.formscoding
BruceM
external usenet poster
 
Posts: 356
Default Complex (for me) custom counter question....

Responses inline.

"Fletcher" wrote in message
oups.com...
Bruce,
The abbreviation is derived from the Process name. Usually some
combination of letter or words that can identify the process. For
example, we have a Spin Rinse Dryer...we abbreviate that with SRD, or
Boron Diffusion is Bdiff, or Gold Arsenic is Gars...it just depends on
what the process is.


Then you will need a table of abbreviations, or some other way of assigning
an abbreviation to a process.

As for starting over at one, it doesn't really matter as long as the
entries in *MeasurementsA* or *MeasurementsB* are related to a given
entry in the *ProcessXData* or *ProcessYData* or *ProcessZData*. We
really only care that a measurment can be attached to a pass through
the machine. Chances are that the engineers won't even see this field.


You are going to be in for a complex bit of coding if you want the same
counter to span several tables, if it is even possible at all. You would be
better off to use a single table, and to designate the record as being for
Process X, Y, or Z (by selecting an option button, or selecting the process
from a list, or chicking a box, or whatever). Either that or you will need
to use a separate counter for each table.

It would help if you provide an example of the numbering sequence you
expect. If the first record is for SRD, the second for BDiff, the third for
SRD, fourth SRD, and fifth BDiff, do you expect to see: SRD1, BDiff1, SRD2,
SRD3, BDiff2, or do you expect: SRD1, BDiff2, SRD3, SRD4, BDiff5? If the
former, I think you will need to store the abbreviation as part of the
number. If the latter, you could just use DMax. Make the table's ID field
Data Type (in table design view) Number (Long Integer). Make a form based
on the table. In the form's Current event:

If Me.NewRecord Then
Me.YourID = Nz(DMax("YourID", "tblYourTable") + 1, 1)
End If

You can concatenate this number with the department abbreviation in an
unbound text box or in a query.
Note that Nz is necessary only for the first record. It may not be
necessary at all if the default value for the field is 0, but I'm not sure.

If you need the number to be, say, five digits each time:
Me.YourID = Format(Nz(DMax("YourID", "tblYourTable") + 1, 1),"0000")


What is the difference between Dmax and DCount?


DMax is the highest value. DCount is the total number of records. If you
have five records (the last one being numbered 5) and delete the fourth one,
the record count will go down to 4. Adding one to that will make it 5,
which you already have. DMax is the highest value. If you have five
records and delete the fourth one, the highest-numbered record will still be
5. Adding one to that will produce a unique number.

Jeff,
I tried your code in Form_Current. I'm having some problems with it
though. Maybe you can help. I put it in very similarly to what you
had (I changed the generic names back to the real names), but I don't
have a Me.ProcessName, so I changed that section to what I wanted it to
be (BDiff, one of the abbr.'s exampled above). The problem is that
first it didn't want to start counting, so I put the first entry in the
table with BDiff1. Then it started counting, but it left off the BDiff
and started putting only numbers in. Any idea how to fix this?

Thanks to you both.

Fletcher...

BruceM wrote:
You're must be specific. How is the abbreviation derived? Knowing that
you
want to specify it in the form's code etc. tells me nothing. If later
personnel change it, do you expect the number to start over from 1 with
the
new abbreviation, or what? Jeff wrote a suggestion along the lines of
what
I would have suggested, except I would have used DMax rather than DCount.

"Fletcher" wrote in message
oups.com...
Is the abbreviation for the process the first five letters of the
process
name, or is it derived otherwise?
The abbreviation is derived otherwise. I would like to specify it in
the forms code and and have it commented so that later personnel will
know where to change it.

Also, do you want the numbers to start from one for each process?
Yes, I do want them to start from one and be sequential.

Thanks,

Fletcher...

BruceM wrote:
Is the abbreviation for the process the first five letters of the
process
name, or is it derived otherwise? Also, do you want the numbers to
start
from one for each process? That is, is the number First001, First002,
etc.
and Second001, Second 002, etc., or is it First001, First002,
Second003,
Second004, etc.?

"Fletcher" wrote in message
oups.com...
Hi, I would like to set up a custom counter for processes in my
facility. I'll list my table structure first, then explain:

*ProcessXData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*ProcessYData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*ProcessZData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*MeasurementsA*
MeasAID, text, PK (linked to DataID)
Top, number
Middle, Number
Bottom, Number

*MeasurementsB*
MeasBID, text, PK (linked to DataID)
MeasData, number
Limit, number

(for simplicity, I lave left out several tables that hold lists of
data
that provide information such as operators and specs; I have also
generic-ized the data to make it easier for you, and not disclose
any
information that could lead to problems)

So, here's the meat of what I'm having trouble doing. I have 3
different processes and each can have a different spec. For
certain
specs on each process, a different measurement is done (MeasurementA
or
MeasurementB). I have this worked out on a form where depending on
the
spec number that you enter, a different subform for measurments will
be
enabled. My dilema is that I can't use autonumber for each process
as
an ID, so I would like to creat a custom counter that includes, say,
the abreviation of process name (4 or 5 letters) and a number. I
cannot think of how to do this, so if anyone would be helpful enough
to
give me some input, I would appreciate it greatly.

Thanks ahead,
Fletcher...





  #10  
Old August 3rd, 2006, 09:56 PM posted to microsoft.public.access.tablesdbdesign,microsoft.public.access.forms,microsoft.public.access.formscoding
Fletcher
external usenet poster
 
Posts: 46
Default Complex (for me) custom counter question....

I can almost get this to work, but I think I need to explainmyself a
bit better apparently. I'll try harder this time.

Then you will need a table of abbreviations, or some other way of assigning
an abbreviation to a process.


We would prefer that we don't put this table in, but rather just have
the code for the counter assign a constant abbreviation. That way, it
can't be changed accidentally. Even though it doesn't matter that it's
constant and we simply desire a correlation between a given measurement
of either type and the pass through a machine (i.e. *ProcessXData*), we
would prefer that this abbreviation stays constant. If I have to use a
table, I can do that...but I don't exactly want to go through and track
down every single abbreviation that we use.

You are going to be in for a complex bit of coding if you want the same
counter to span several tables, if it is even possible at all. You would be
better off to use a single table, and to designate the record as being for
Process X, Y, or Z (by selecting an option button, or selecting the process
from a list, or chicking a box, or whatever). Either that or you will need
to use a separate counter for each table.


Your last sentence was right on the money. That's exactly what I would
like to do.

It would help if you provide an example of the numbering sequence you
expect.


For example, I expect the counter for *ProcessXData* to go soemthing
like this:
PrcX1
PrcX2
PrcX3
And so on.
And for *ProcessYData* :
PrcY1
PrcY2
PrcY4
and the same for *ProcessZData*.

With the relationship, forms and subforms being used a given
measurement for any process will acquire the same entry for it's ID
field as it's corresponding Process pass.

Make the table's ID field Data Type (in table design view) Number (Long Integer).
Make a form based on the table.


The point of this post was to find a way to get away from the numeric
ID (because we can't have every entry in 3 different process tables
with numeric ID's).

You can concatenate this number with the department abbreviation in an
unbound text box or in a query.


Unless this can be stored in the Process?Data.DataID field, it won't
help.

We really need an ID field with a unique identifying field, and the
only thing I can personally think of is the process abbr and a number.

I have no idea how to do this though. I imagine that it would have to
look at the previous entries and take off the abbreviation, then find
the maximum number, add one to it, and then put the abbreviation back
onto it. The only thing that I have trouble with is the coding.

And thanks for taking the time to respond.

Fletcher....

BruceM wrote:
Responses inline.

"Fletcher" wrote in message
oups.com...
Bruce,
The abbreviation is derived from the Process name. Usually some
combination of letter or words that can identify the process. For
example, we have a Spin Rinse Dryer...we abbreviate that with SRD, or
Boron Diffusion is Bdiff, or Gold Arsenic is Gars...it just depends on
what the process is.


Then you will need a table of abbreviations, or some other way of assigning
an abbreviation to a process.

As for starting over at one, it doesn't really matter as long as the
entries in *MeasurementsA* or *MeasurementsB* are related to a given
entry in the *ProcessXData* or *ProcessYData* or *ProcessZData*. We
really only care that a measurment can be attached to a pass through
the machine. Chances are that the engineers won't even see this field.


You are going to be in for a complex bit of coding if you want the same
counter to span several tables, if it is even possible at all. You would be
better off to use a single table, and to designate the record as being for
Process X, Y, or Z (by selecting an option button, or selecting the process
from a list, or chicking a box, or whatever). Either that or you will need
to use a separate counter for each table.

It would help if you provide an example of the numbering sequence you
expect. If the first record is for SRD, the second for BDiff, the third for
SRD, fourth SRD, and fifth BDiff, do you expect to see: SRD1, BDiff1, SRD2,
SRD3, BDiff2, or do you expect: SRD1, BDiff2, SRD3, SRD4, BDiff5? If the
former, I think you will need to store the abbreviation as part of the
number. If the latter, you could just use DMax. Make the table's ID field
Data Type (in table design view) Number (Long Integer). Make a form based
on the table. In the form's Current event:

If Me.NewRecord Then
Me.YourID = Nz(DMax("YourID", "tblYourTable") + 1, 1)
End If

You can concatenate this number with the department abbreviation in an
unbound text box or in a query.
Note that Nz is necessary only for the first record. It may not be
necessary at all if the default value for the field is 0, but I'm not sure.

If you need the number to be, say, five digits each time:
Me.YourID = Format(Nz(DMax("YourID", "tblYourTable") + 1, 1),"0000")


What is the difference between Dmax and DCount?


DMax is the highest value. DCount is the total number of records. If you
have five records (the last one being numbered 5) and delete the fourth one,
the record count will go down to 4. Adding one to that will make it 5,
which you already have. DMax is the highest value. If you have five
records and delete the fourth one, the highest-numbered record will still be
5. Adding one to that will produce a unique number.

Jeff,
I tried your code in Form_Current. I'm having some problems with it
though. Maybe you can help. I put it in very similarly to what you
had (I changed the generic names back to the real names), but I don't
have a Me.ProcessName, so I changed that section to what I wanted it to
be (BDiff, one of the abbr.'s exampled above). The problem is that
first it didn't want to start counting, so I put the first entry in the
table with BDiff1. Then it started counting, but it left off the BDiff
and started putting only numbers in. Any idea how to fix this?

Thanks to you both.

Fletcher...

BruceM wrote:
You're must be specific. How is the abbreviation derived? Knowing that
you
want to specify it in the form's code etc. tells me nothing. If later
personnel change it, do you expect the number to start over from 1 with
the
new abbreviation, or what? Jeff wrote a suggestion along the lines of
what
I would have suggested, except I would have used DMax rather than DCount.

"Fletcher" wrote in message
oups.com...
Is the abbreviation for the process the first five letters of the
process
name, or is it derived otherwise?
The abbreviation is derived otherwise. I would like to specify it in
the forms code and and have it commented so that later personnel will
know where to change it.

Also, do you want the numbers to start from one for each process?
Yes, I do want them to start from one and be sequential.

Thanks,

Fletcher...

BruceM wrote:
Is the abbreviation for the process the first five letters of the
process
name, or is it derived otherwise? Also, do you want the numbers to
start
from one for each process? That is, is the number First001, First002,
etc.
and Second001, Second 002, etc., or is it First001, First002,
Second003,
Second004, etc.?

"Fletcher" wrote in message
oups.com...
Hi, I would like to set up a custom counter for processes in my
facility. I'll list my table structure first, then explain:

*ProcessXData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*ProcessYData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*ProcessZData*
DataID, where I want the custom counter, PK
Spec, number
ProcessDateTime, date/time, Now()
Operator, text
Comments, memo

*MeasurementsA*
MeasAID, text, PK (linked to DataID)
Top, number
Middle, Number
Bottom, Number

*MeasurementsB*
MeasBID, text, PK (linked to DataID)
MeasData, number
Limit, number

(for simplicity, I lave left out several tables that hold lists of
data
that provide information such as operators and specs; I have also
generic-ized the data to make it easier for you, and not disclose
any
information that could lead to problems)

So, here's the meat of what I'm having trouble doing. I have 3
different processes and each can have a different spec. For
certain
specs on each process, a different measurement is done (MeasurementA
or
MeasurementB). I have this worked out on a form where depending on
the
spec number that you enter, a different subform for measurments will
be
enabled. My dilema is that I can't use autonumber for each process
as
an ID, so I would like to creat a custom counter that includes, say,
the abreviation of process name (4 or 5 letters) and a number. I
cannot think of how to do this, so if anyone would be helpful enough
to
give me some input, I would appreciate it greatly.

Thanks ahead,
Fletcher...




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Complex Sort Question Chas Worksheet Functions 2 March 16th, 2006 02:14 AM
Custom Animation A Diffferent Question [email protected] Powerpoint 1 September 14th, 2005 05:04 AM
A Complex Mail Merge Question Erik Tice Mailmerge 2 May 29th, 2004 05:58 AM
hit counter question Bob Chapman Links and Linking 0 March 4th, 2004 02:31 AM
Custom color question + smooth chart curves question Gern Blanston Charts and Charting 2 November 14th, 2003 02:42 AM


All times are GMT +1. The time now is 03:38 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.