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

Changing Text boxes Control Source in detail section of form

Status
Not open for further replies.

Beeps

Programmer
Aug 28, 2001
128
US
Hi all,

I have a slight problem with a form based on a query that I'm using to update records.

This db is used to track documents and there is 12 dates that I need to track based upon the document status. For instance if the document is being drafted, the status is "Doc Generation" and there is two dates for that status, "Doc Gen Start" and "Doc Gen End". Next would be Status of Approval Routing with towe dates "Doc Routing Approval Start", and "Doc Routing Approval End". Etc etc for 5 more status qualities.

What I was hoping to do is change the text boxes that have both dates to the fields of the dynamic query(which the form is based on) to match the appropriate status. For instance if the status is "Doc Generation", I just want the two doc generation dates. This would eliminate lots of unneeded dates on the form. I can change the control source for the tow text boxes by the criteria of the status, but that changes the ALL the text boxes. I just want to change for the paticular record. I'm pretty good with VB, but I'm stuck on this one.

Any help would be appriciated. Thanks
 
Hi!

What event are you using? If you put your code in Form_Current to check the status and change the control sources, they should change every time you change records. Of course, that will only work well in form view, not datasheet view.

hth
Jeff Bridgham
bridgham@purdue.edu
 
I'm using the after_update event of the combo box which hold the status. That'll update the text box control source but it updates everyone of them because they have the same name. (The status combo as well as the text boxes are in the detail section of the form)

thanks for responding, any ideas?
 
Hi Again!

It sounds like you are viewing the form as a datasheet, if that is the case then, as far as I know, all of the records will change just as you describe. If you use the code in the Form_Current as I suggested before, the boxes will at least reflect the status of the currently selected record.

Sorry
Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top