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!

Update form a with the result of b 1

Status
Not open for further replies.

kennetha

Programmer
Sep 10, 2003
105
MT
Hi all

I'm using two forms of which;
a) is a search for an item code form
b) is what about the item such description and plenty other stuff and details.

Form a) is opened by a command button when needed. When a code is found from a search it is "pasted" on b) by double click.

Here's the code:

If IsLoaded("b") Then
'Forms!![txtproductid] = Me.productID
'Forms!.Refresh
'DoCmd.close acForm, "a"
'Exit Sub
'End If

txtproductid on b is a combo box. There is also an afterupdate event on txtproductid so it should update automatically

It should work...no? Suggestions more than welcome
Thanks in advance
Kenneth


 
The AfterUpdate event of a control is only triggered by a manual change (ie code changing the value of a control don't raise the AfterUpdate event)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
kennetha said:
[blue]It should work...no?[/blue]
All will work save the automation expected by the combo's [blue]AfterUpdate[/blue] event.

To get around this make a public common routine out it, then call the routine:

For the AfterUpdate event:
Code:
[blue]   Call [purple][b][i]CommonRoutineName[/i][/b][/purple][/blue]
For the search form:
Code:
[blue]   If IsLoaded("b") Then
       Forms![b]![txtproductid] = Me.productID
       Forms![b].[purple][b][i]CommonRoutineName[/i][/b][/purple]
       DoCmd.Close acForm, "a"
   End If[/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top