Combo box

G

Guest

Hi I have a 2 part question
-First Part I have a combo box that displays all records in a combo box,
which intern generates the rest of the information in the text boxes. I have
duplicate Numbers in the combo box, what I would like to do is add a field to
count from 1 to what ever based on how many records have this number.

Ex 1234 is a record and I typed it in first so in Field (Record #) it equals
1.
Then I make new record 1234 and I would like Field(Record #) to equal 2
-Once this is done I want to make the combo box three colums
(rowID,Number,Record#),BUT I would like coding for the combo box to only show
records with a "1" in its (record #) field..

PLease HELP
 
M

ManningFan

Part 1 - "intern" is a person, "in turn" is a phrase.

Part 2 - You would have to add data to a table behind the combo box and
requery that table. It sounds like a waste of time, I have absolutely
no idea as to why anyone would want to do something like this. What
are you hoping to accomplish?
 
G

Guest

If your objective it so only show each value in Number only once, you can use
a query to do that for you. The only problem I see is what is the use of the
RowID?

But, ignoring that for the moment and returning a single instance of each
value in Number, you can make the combo's row source something like;
SELECT DISTINCT [Number] FROM YourTable Name ORDER BY [Number];
 
G

Guest

I am sorry I posted that message in a hurry..

What I have is a motor database
one form has a bunch of field tied to a table(NamePlate)
(NamePlate) is a data input form
-Next, Form (Repair) is based on a field(PRNumber)
-PRNumber is then placed into a combo box to display records
-Form (Repair) has the same linked field text boxes as the input data form ,
so once the PRNumber is chosen it displays the record through out the field
related text boxes.
-In Form (Repair) I have a button that duplicates the information so I
change data under an already existing PRNumber, but store it as a new record.
Since I now will have the same PRNumber pop up in the list of the combo box,
I would like the combo box to just display the initial record not the
repaired version.
-So what I was saying before, I was wondering if I could make another field
in my table that would put a counter on a record that has been used more then
once. Example: if my PRNumber is 12RT and it was the first record of this
number I would like that field to automatically put a "1" there. And
Everytime there is a repair to that PRNumber(since it would be a new record)
I would like it to count up(next one being 2)
-After this is Done I would like the combo box on the (repair) form to only
display records with a "1" in the new field. This I want done, because I
only want the user to make repairs from the inital information...

Thanks, sorry for the confusion

Klatuu said:
If your objective it so only show each value in Number only once, you can use
a query to do that for you. The only problem I see is what is the use of the
RowID?

But, ignoring that for the moment and returning a single instance of each
value in Number, you can make the combo's row source something like;
SELECT DISTINCT [Number] FROM YourTable Name ORDER BY [Number];


BIGRED56 said:
Hi I have a 2 part question
-First Part I have a combo box that displays all records in a combo box,
which intern generates the rest of the information in the text boxes. I have
duplicate Numbers in the combo box, what I would like to do is add a field to
count from 1 to what ever based on how many records have this number.

Ex 1234 is a record and I typed it in first so in Field (Record #) it equals
1.
Then I make new record 1234 and I would like Field(Record #) to equal 2
-Once this is done I want to make the combo box three colums
(rowID,Number,Record#),BUT I would like coding for the combo box to only show
records with a "1" in its (record #) field..

PLease HELP
 
G

Guest

If you want to put the next number in the field:
Next Num = Nz(DMax("[numberfield]", "mytable", "[PRNumber] = " &
Me.PrNumber), 0) + 1

Then the row source for the combo:
SELECT DISTINCT [PRNumber] FROM YourTable Name WHERE [SequenceNumber] = 1
ORDER BY [PRNumber];

BIGRED56 said:
I am sorry I posted that message in a hurry..

What I have is a motor database
one form has a bunch of field tied to a table(NamePlate)
(NamePlate) is a data input form
-Next, Form (Repair) is based on a field(PRNumber)
-PRNumber is then placed into a combo box to display records
-Form (Repair) has the same linked field text boxes as the input data form ,
so once the PRNumber is chosen it displays the record through out the field
related text boxes.
-In Form (Repair) I have a button that duplicates the information so I
change data under an already existing PRNumber, but store it as a new record.
Since I now will have the same PRNumber pop up in the list of the combo box,
I would like the combo box to just display the initial record not the
repaired version.
-So what I was saying before, I was wondering if I could make another field
in my table that would put a counter on a record that has been used more then
once. Example: if my PRNumber is 12RT and it was the first record of this
number I would like that field to automatically put a "1" there. And
Everytime there is a repair to that PRNumber(since it would be a new record)
I would like it to count up(next one being 2)
-After this is Done I would like the combo box on the (repair) form to only
display records with a "1" in the new field. This I want done, because I
only want the user to make repairs from the inital information...

Thanks, sorry for the confusion

Klatuu said:
If your objective it so only show each value in Number only once, you can use
a query to do that for you. The only problem I see is what is the use of the
RowID?

But, ignoring that for the moment and returning a single instance of each
value in Number, you can make the combo's row source something like;
SELECT DISTINCT [Number] FROM YourTable Name ORDER BY [Number];


BIGRED56 said:
Hi I have a 2 part question
-First Part I have a combo box that displays all records in a combo box,
which intern generates the rest of the information in the text boxes. I have
duplicate Numbers in the combo box, what I would like to do is add a field to
count from 1 to what ever based on how many records have this number.

Ex 1234 is a record and I typed it in first so in Field (Record #) it equals
1.
Then I make new record 1234 and I would like Field(Record #) to equal 2
-Once this is done I want to make the combo box three colums
(rowID,Number,Record#),BUT I would like coding for the combo box to only show
records with a "1" in its (record #) field..

PLease HELP
 
G

Guest

Hey thanks for the code, but I am still having a problem. Instead of counting
the number stays at zero in the Number Field. I have a text box named Next
Num

Next Num = Nz(DMax("[DayToFailure]", "NamePlate", "[PRNumber] = " &
Me.PRNumber), 0) + 1


Klatuu said:
If you want to put the next number in the field:
Next Num = Nz(DMax("[numberfield]", "mytable", "[PRNumber] = " &
Me.PrNumber), 0) + 1

Then the row source for the combo:
SELECT DISTINCT [PRNumber] FROM YourTable Name WHERE [SequenceNumber] = 1
ORDER BY [PRNumber];

BIGRED56 said:
I am sorry I posted that message in a hurry..

What I have is a motor database
one form has a bunch of field tied to a table(NamePlate)
(NamePlate) is a data input form
-Next, Form (Repair) is based on a field(PRNumber)
-PRNumber is then placed into a combo box to display records
-Form (Repair) has the same linked field text boxes as the input data form ,
so once the PRNumber is chosen it displays the record through out the field
related text boxes.
-In Form (Repair) I have a button that duplicates the information so I
change data under an already existing PRNumber, but store it as a new record.
Since I now will have the same PRNumber pop up in the list of the combo box,
I would like the combo box to just display the initial record not the
repaired version.
-So what I was saying before, I was wondering if I could make another field
in my table that would put a counter on a record that has been used more then
once. Example: if my PRNumber is 12RT and it was the first record of this
number I would like that field to automatically put a "1" there. And
Everytime there is a repair to that PRNumber(since it would be a new record)
I would like it to count up(next one being 2)
-After this is Done I would like the combo box on the (repair) form to only
display records with a "1" in the new field. This I want done, because I
only want the user to make repairs from the inital information...

Thanks, sorry for the confusion

Klatuu said:
If your objective it so only show each value in Number only once, you can use
a query to do that for you. The only problem I see is what is the use of the
RowID?

But, ignoring that for the moment and returning a single instance of each
value in Number, you can make the combo's row source something like;
SELECT DISTINCT [Number] FROM YourTable Name ORDER BY [Number];


:

Hi I have a 2 part question
-First Part I have a combo box that displays all records in a combo box,
which intern generates the rest of the information in the text boxes. I have
duplicate Numbers in the combo box, what I would like to do is add a field to
count from 1 to what ever based on how many records have this number.

Ex 1234 is a record and I typed it in first so in Field (Record #) it equals
1.
Then I make new record 1234 and I would like Field(Record #) to equal 2
-Once this is done I want to make the combo box three colums
(rowID,Number,Record#),BUT I would like coding for the combo box to only show
records with a "1" in its (record #) field..

PLease HELP
 
G

Guest

I don't understand what you mean by stays at 0. Also, if you are using a
name with a space in it (you really should not have spaces in names), you
need to put it in brackets [Next Num]. The way you have it coded, it is
adding 1 to whatever is returned from the field [DayToFailure]. Is that what
you are trying to do?

BIGRED56 said:
Hey thanks for the code, but I am still having a problem. Instead of counting
the number stays at zero in the Number Field. I have a text box named Next
Num

Next Num = Nz(DMax("[DayToFailure]", "NamePlate", "[PRNumber] = " &
Me.PRNumber), 0) + 1


Klatuu said:
If you want to put the next number in the field:
Next Num = Nz(DMax("[numberfield]", "mytable", "[PRNumber] = " &
Me.PrNumber), 0) + 1

Then the row source for the combo:
SELECT DISTINCT [PRNumber] FROM YourTable Name WHERE [SequenceNumber] = 1
ORDER BY [PRNumber];

BIGRED56 said:
I am sorry I posted that message in a hurry..

What I have is a motor database
one form has a bunch of field tied to a table(NamePlate)
(NamePlate) is a data input form
-Next, Form (Repair) is based on a field(PRNumber)
-PRNumber is then placed into a combo box to display records
-Form (Repair) has the same linked field text boxes as the input data form ,
so once the PRNumber is chosen it displays the record through out the field
related text boxes.
-In Form (Repair) I have a button that duplicates the information so I
change data under an already existing PRNumber, but store it as a new record.
Since I now will have the same PRNumber pop up in the list of the combo box,
I would like the combo box to just display the initial record not the
repaired version.
-So what I was saying before, I was wondering if I could make another field
in my table that would put a counter on a record that has been used more then
once. Example: if my PRNumber is 12RT and it was the first record of this
number I would like that field to automatically put a "1" there. And
Everytime there is a repair to that PRNumber(since it would be a new record)
I would like it to count up(next one being 2)
-After this is Done I would like the combo box on the (repair) form to only
display records with a "1" in the new field. This I want done, because I
only want the user to make repairs from the inital information...

Thanks, sorry for the confusion

:

If your objective it so only show each value in Number only once, you can use
a query to do that for you. The only problem I see is what is the use of the
RowID?

But, ignoring that for the moment and returning a single instance of each
value in Number, you can make the combo's row source something like;
SELECT DISTINCT [Number] FROM YourTable Name ORDER BY [Number];


:

Hi I have a 2 part question
-First Part I have a combo box that displays all records in a combo box,
which intern generates the rest of the information in the text boxes. I have
duplicate Numbers in the combo box, what I would like to do is add a field to
count from 1 to what ever based on how many records have this number.

Ex 1234 is a record and I typed it in first so in Field (Record #) it equals
1.
Then I make new record 1234 and I would like Field(Record #) to equal 2
-Once this is done I want to make the combo box three colums
(rowID,Number,Record#),BUT I would like coding for the combo box to only show
records with a "1" in its (record #) field..

PLease HELP
 
G

Guest

OK so what I did was place a textbox in the middle of my form called txtCounter
I enter this into its source code

= Nz(DMax("[DayToFailure]", "NamePlate", "[PRNumber] = " &
Me.PRNumber), 0) + 1
But in the "DayToFailure" field all that appears is a zero in all records.
Klatuu said:
I don't understand what you mean by stays at 0. Also, if you are using a
name with a space in it (you really should not have spaces in names), you
need to put it in brackets [Next Num]. The way you have it coded, it is
adding 1 to whatever is returned from the field [DayToFailure]. Is that what
you are trying to do?

BIGRED56 said:
Hey thanks for the code, but I am still having a problem. Instead of counting
the number stays at zero in the Number Field. I have a text box named Next
Num

Next Num = Nz(DMax("[DayToFailure]", "NamePlate", "[PRNumber] = " &
Me.PRNumber), 0) + 1


Klatuu said:
If you want to put the next number in the field:
Next Num = Nz(DMax("[numberfield]", "mytable", "[PRNumber] = " &
Me.PrNumber), 0) + 1

Then the row source for the combo:
SELECT DISTINCT [PRNumber] FROM YourTable Name WHERE [SequenceNumber] = 1
ORDER BY [PRNumber];

:

I am sorry I posted that message in a hurry..

What I have is a motor database
one form has a bunch of field tied to a table(NamePlate)
(NamePlate) is a data input form
-Next, Form (Repair) is based on a field(PRNumber)
-PRNumber is then placed into a combo box to display records
-Form (Repair) has the same linked field text boxes as the input data form ,
so once the PRNumber is chosen it displays the record through out the field
related text boxes.
-In Form (Repair) I have a button that duplicates the information so I
change data under an already existing PRNumber, but store it as a new record.
Since I now will have the same PRNumber pop up in the list of the combo box,
I would like the combo box to just display the initial record not the
repaired version.
-So what I was saying before, I was wondering if I could make another field
in my table that would put a counter on a record that has been used more then
once. Example: if my PRNumber is 12RT and it was the first record of this
number I would like that field to automatically put a "1" there. And
Everytime there is a repair to that PRNumber(since it would be a new record)
I would like it to count up(next one being 2)
-After this is Done I would like the combo box on the (repair) form to only
display records with a "1" in the new field. This I want done, because I
only want the user to make repairs from the inital information...

Thanks, sorry for the confusion

:

If your objective it so only show each value in Number only once, you can use
a query to do that for you. The only problem I see is what is the use of the
RowID?

But, ignoring that for the moment and returning a single instance of each
value in Number, you can make the combo's row source something like;
SELECT DISTINCT [Number] FROM YourTable Name ORDER BY [Number];


:

Hi I have a 2 part question
-First Part I have a combo box that displays all records in a combo box,
which intern generates the rest of the information in the text boxes. I have
duplicate Numbers in the combo box, what I would like to do is add a field to
count from 1 to what ever based on how many records have this number.

Ex 1234 is a record and I typed it in first so in Field (Record #) it equals
1.
Then I make new record 1234 and I would like Field(Record #) to equal 2
-Once this is done I want to make the combo box three colums
(rowID,Number,Record#),BUT I would like coding for the combo box to only show
records with a "1" in its (record #) field..

PLease HELP
 
G

Guest

Okay, but what is in txtCounter?
Where do you have the code to populate the DayToFailure control on your form?
If DayToFailure field is what you want to increment by PRNumber, then the
code should go in the PRNumber After Update event.

Me.PrNumber = Nz(DMax("[DayToFailure]", "NamePlate", "[PRNumber] = " &
Me.PRNumber), 0) + 1


BIGRED56 said:
OK so what I did was place a textbox in the middle of my form called txtCounter
I enter this into its source code

= Nz(DMax("[DayToFailure]", "NamePlate", "[PRNumber] = " &
Me.PRNumber), 0) + 1
But in the "DayToFailure" field all that appears is a zero in all records.
Klatuu said:
I don't understand what you mean by stays at 0. Also, if you are using a
name with a space in it (you really should not have spaces in names), you
need to put it in brackets [Next Num]. The way you have it coded, it is
adding 1 to whatever is returned from the field [DayToFailure]. Is that what
you are trying to do?

BIGRED56 said:
Hey thanks for the code, but I am still having a problem. Instead of counting
the number stays at zero in the Number Field. I have a text box named Next
Num

Next Num = Nz(DMax("[DayToFailure]", "NamePlate", "[PRNumber] = " &
Me.PRNumber), 0) + 1


:

If you want to put the next number in the field:
Next Num = Nz(DMax("[numberfield]", "mytable", "[PRNumber] = " &
Me.PrNumber), 0) + 1

Then the row source for the combo:
SELECT DISTINCT [PRNumber] FROM YourTable Name WHERE [SequenceNumber] = 1
ORDER BY [PRNumber];

:

I am sorry I posted that message in a hurry..

What I have is a motor database
one form has a bunch of field tied to a table(NamePlate)
(NamePlate) is a data input form
-Next, Form (Repair) is based on a field(PRNumber)
-PRNumber is then placed into a combo box to display records
-Form (Repair) has the same linked field text boxes as the input data form ,
so once the PRNumber is chosen it displays the record through out the field
related text boxes.
-In Form (Repair) I have a button that duplicates the information so I
change data under an already existing PRNumber, but store it as a new record.
Since I now will have the same PRNumber pop up in the list of the combo box,
I would like the combo box to just display the initial record not the
repaired version.
-So what I was saying before, I was wondering if I could make another field
in my table that would put a counter on a record that has been used more then
once. Example: if my PRNumber is 12RT and it was the first record of this
number I would like that field to automatically put a "1" there. And
Everytime there is a repair to that PRNumber(since it would be a new record)
I would like it to count up(next one being 2)
-After this is Done I would like the combo box on the (repair) form to only
display records with a "1" in the new field. This I want done, because I
only want the user to make repairs from the inital information...

Thanks, sorry for the confusion

:

If your objective it so only show each value in Number only once, you can use
a query to do that for you. The only problem I see is what is the use of the
RowID?

But, ignoring that for the moment and returning a single instance of each
value in Number, you can make the combo's row source something like;
SELECT DISTINCT [Number] FROM YourTable Name ORDER BY [Number];


:

Hi I have a 2 part question
-First Part I have a combo box that displays all records in a combo box,
which intern generates the rest of the information in the text boxes. I have
duplicate Numbers in the combo box, what I would like to do is add a field to
count from 1 to what ever based on how many records have this number.

Ex 1234 is a record and I typed it in first so in Field (Record #) it equals
1.
Then I make new record 1234 and I would like Field(Record #) to equal 2
-Once this is done I want to make the combo box three colums
(rowID,Number,Record#),BUT I would like coding for the combo box to only show
records with a "1" in its (record #) field..

PLease HELP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top