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

Use the value in the combo box for a quey and then use the new value 1

Status
Not open for further replies.

captphan

Programmer
Jan 24, 2007
42
I have a combo box in a form. Before I change it I need to adjust records in various tables based on the value. Then I need to use the new value to update the sub forms.

The only way I have found to use the existing value is the On Get Focus property. This cause the user to have to wait for the updates then select a new value and then wait for the subfroms to requery.

I want something that is less obtrusive to the user. Any suggestions?
 
How are ya captphan . . .

Your post is [blue]vague[/blue] (I'm sure not to you). You'll need to [blue]be more specific[/blue] to get an answer [thumbsup2}

BTW: [blue]Welcome to Tek-Tips![/blue] To get great answers and know whats expected of you in the forums be sure to have a look at FAQ219-2884 [thumbsup2]

Calvin.gif
See Ya! . . . . . .
 
Let me try to be more specific


I have a form with three subforms

They are all controlled by a dropdown box in the main form.

The information in Subform3 needs to be moved to Subfrom1. There are to checkbox fields that determine how the records in Subform3 are placed in Subfrom1.

After checking the appropriate boxes the user can either select an update button which will move the data and then requery the subforms based on the dropdown box value or goto the drop down box and move to the next value.

When moving to the next value a fuction is called to move the data from subform3 to subform1. (this function is called by update as well) This function needs the value in the combo box before it is changed. Then after the value is changed all three subforms are requeried. With the new value.

The only way I have found to use the existing value is the On Get Focus property. This cause the user to have to wait for the updates then select a new value and then wait for the subfroms to requery.
 
I reread this and it has dawned on me that I never gave on important piece of information. This is Access 97
 
captphan . . .

You can [blue]hold the combo value in a variable[/blue] in the delcarations section of the mainform or a hidden textbox on the mainform using the [blue]On Enter[/blue] event of the combo . . .
Code:
[blue]   [b][i]variable[/i][/b] = Me![b][i]ComboboxName[/i][/b].Column(?)
'or
   Me![b][i]HiddentextboxName[/i][/b] = Me![b][i]ComboboxName[/i][/b].Column(?)[/blue]

Calvin.gif
See Ya! . . . . . .
 
Of course.

Thank You, that is working perfectly.[bigsmile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top