List box doesn't update?

bruceyp

New member
Local time
Today, 21:53
Joined
Jun 22, 2000
Messages
7
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.
 
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
 
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.
 
Try this...

On Error Resume Next
[Forms]![Form1Name]![ListBoxName].Requery
[Forms]![Form1Name].Refresh
 
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
 
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 !
 

Users who are viewing this thread

Back
Top Bottom