Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to automatically fill in a field in a table 1

Status
Not open for further replies.

Parula

Programmer
May 10, 2001
18
US
Hello all, my husband recomended this site. He says there are geniuses out here. So here's my dilema.

I am creating a access file that outputs info to a mail sorter. My goal is to use zip codes to pull addresses from a huge local address database based on the users request of how many addresses he wants. Now after he chooses a certain number of addresses (say first 100 address in this zip code), after he chooses them, those addresses should not be availbile again for a subseqent request. In otherwords, if he choose 100. Then immedeiately he chooses another hundrend, I don't want the same addressed to be pulled.

Technically speaking:
When the user of this application I'm creating runs a quiery, he is asked to enter a zip code. My quiery will count the number of people in that zip code and give the user a figure. Now the users than enters the number of address from that figure he wants to pull and sent to the automatic mailer. I want to be able to update my customer records in such as way as to check off those that were chosen and already sent. (Therefore, when he does this quiery again, that number of total addresses in that zipcode should be decreased by that amount. I don't want him to send out the mailers to the same 100 people).
To do this, I created another field in my customer database called "sent, yes or no check box which is default to no". Now if I manual check off some boxes, my quiery responds the way I want it to. BUT I want this to happen automatically. I or the user shouldn't have to manul check off those that were sent. HOW CAN I RUN IT SO THAT IT AUTOMATICALLY CHECKS the BOXES.

I apologize for the length of this, I just am new an am learning how best to ask quesitons on this board.
 
Hiya,

What you need to do is update your table when you pull the x number of records.

For example:

User selects a zip code, which returns a value of 100
User then chooses to mail to 50 of those addresses
Program selects 50 addresses
Program updates the sent yes/no box to become yes for the same 50 addresses.

Tim
 
Hi Tim1

Yes I need to update a table when the user pulls x number of records. However, I also want is after a certain period of time the records should be come active again. I would like to do just what your example said. Can you please help me?

User selects a zip code, which returns a value of 100
User then chooses to mail to 50 of those addresses
Program selects 50 addresses
Program updates the sent yes/no box to become yes for the same 50 addresses.
 
The final solution depends on the way your program is structured. One easy way is to create a temporary table into which all the selected addresses are place. After this is done, run an update command which takes the form


Update address_table set sent = true where address in (select address from temporary table)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top