bruceyp
06-22-2000, 06:50 PM
I have created a requesition form that has a list box to select a joborder number. if the joborder number is not on the list I have set "On Double click" to open another form to accept the new Joborder number and some other data. this form works ( the data gets put in the Joborder table but i cannot get the new joborder number to appear in the original list box, unless i close out both forms and reopen them. Any suggestions will be helpful. PS I don't have any VB experiance.
KevinM
06-23-2000, 04:07 AM
On the OnClose Event Procedure of the SECOND form put...
On Error Resume Next
[Forms]![Form1Name]![ListBoxName].Requery
End Sub
Change the above with your names.
HTH
Kevin M
bruceyp
06-26-2000, 12:46 PM
Thank you for your help but this didn't work. The same thing happened. The new data still doesn't appear unless I close the forms and reopen them, then the new info is there in the list box.
KevinM
06-27-2000, 01:32 AM
Try this...
On Error Resume Next
[Forms]![Form1Name]![ListBoxName].Requery
[Forms]![Form1Name].Refresh
bruceyp
06-27-2000, 12:47 PM
Kevin,
Thanks that did the trick. The new number is now in the list! Could I press my luck with one more question? Can I get that new number to stay in the list window, rather then going down the list to retreve it?
thanks again.
BP
KevinM
06-28-2000, 02:27 AM
Hmmm...Good question
What you want is to 'remember' the new value you just put in the popup form and have the list box default to it.
This is a long shot (no guarantees!)
On the command button that closes the form try this...
Me.Refresh
[Forms]![Form1Name]![ListBoxName].Requery
[Forms]![Form1Name].Refresh
[Forms]![Form1Name]![ListBoxName]= _
Me![MyField]
DoCmd.Close
[Forms]![Form1Name]![ListBoxName].SetFocus
HTH
Let Me Know !