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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data in one field based on another field on subform

Status
Not open for further replies.

JoeMicro

Technical User
Aug 24, 2007
76
CA
HI

i have got a few questions but let me start with one at a time.

i have got a subform

Field1 = RecordID
Field2 = AccountNo
Field3 = Group

i would like to have a button that gives to each AccountNo a Group no., meaning that if there is a few of the same AccountNo's it should all have the same Group #, and so on.

Ex:

AccountNo Group
AC22 2311
AC22 2311
FG56 2312
AC22 2311
FG56 2312

Thank you
Joe
 

Create a button that runs an update query. But what is the source of the Group number? Meaning, where is this value provided from before the update? Or do you want the subroutine to go find the first account/group number, and then update any others having null group numbers? If you want it to find and populate, then you'll have to incorporate a prelimiary step(query) that finds the records to be updated.

Mike
 
thanks mike

for the groupNo, i could simply have the first in a textbox on the main form and then it should increment.

but for the update query. whats my query?


joe
 
i couldn’t find anything concrete so i just did a workaround.

i append all unique AccountNo's to a table, give them a GroupNo. with an Update Query, then i update my SubForm from that Table.

Joe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top