Increment filed based on a a combo box.

  • Thread starter Thread starter yiotaa
  • Start date Start date
Y

yiotaa

I want to an increment field based in a selection I make in combo box.
I have a combo named Country and I want each time I select a country the
increment to be continue for each country seperate.
I write in the after update event the following code:
Me.IncrementNo = DCount("[serno]", "[qry_villages]", "& me.Country") + 1
It seems that it works but in "& me.Country", it takes the value of
countryid and not the country name i choose in the combo box.
 
I'm not sure I understand.

It sounds like you are trying to add 1 to a country's name. How are you
"adding" text and numbers? Or are you trying to concatenate a CountryName
and the character 1, resulting in CountryName1? If so, why? What will
having CountryName1 allow you to do? And would you then do that again and
get CountryName11?

Please describe why you are doing this. What business need are you trying
to solve with this approach?

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 
I'm not sure I understand.

It sounds like you are trying to add 1 to a country's name.

I was thinking something more like this:

CREATE PROCEDURE Vote
(
arg_country_code CHAR(3) = 'UKR'
)
AS
UPDATE Votes
SET vote_tally = vote_tally + 1
WHERE country_code = arg_country_code;

Jamie.

--
 
Back
Top