Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 3rd, 2007, 03:04 PM
Registered User
 
Join Date: Aug 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Subform Record Saved, Update/Requery Form controls

I have Form1 with combo box linked to listbox that display available "widgets" (those NOT issued). The user selects "widget" in list box and then 'tabs' to subform1 to enter EmployeeID and EmployeeName (other fields are autofilled from listbox columns.

I am trying to get the Issued field(boolean) in the Form updated to "True" after saving new record on subform. I would also like the listbox to requery so the issued "widget" is removed from the listbox and the Form is refreshed.

I have tried different methods but I cannot get the listbox to requery or the Form to refresh.

Please excuse me if this is unclear, can someone help me with this code?

I am chasing my tail at this point.

Thanks,
Chance...

Not about Me!
 
Old August 3rd, 2007, 03:39 PM
Friend of Wrox
 
Join Date: Feb 2007
Posts: 163
Thanks: 0
Thanked 2 Times in 2 Posts
Default

First, save the record on your form... if it's not saved then the table query will show the previous value(s).

From your subform:
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
'Note: Could also try me.recordset.update instead of above but found it doesn't always work consistently right
Forms("FormName").refresh 'Refreshes the form named
Forms("FormName").My_Combo.Requery 'Requeries for combo box content on the form named

 
Old August 6th, 2007, 02:35 PM
Registered User
 
Join Date: Aug 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by allenm
 First, save the record on your form... if it's not saved then the table query will show the previous value(s).

From your subform:
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
'Note: Could also try me.recordset.update instead of above but found it doesn't always work consistently right
Forms("FormName").refresh 'Refreshes the form named
Forms("FormName").My_Combo.Requery 'Requeries for combo box content on the form named

The form refreshed and listbox requery work great. I set the event to also refocus on the combobox so the user can select next widget to assign.

Thanks for the help.

Thanks,

Chance...





Similar Threads
Thread Thread Starter Forum Replies Last Post
Using saved query to do update kscase VB Databases Basics 0 June 7th, 2007 11:46 AM
Requery a subform aware Access 3 December 27th, 2005 12:25 PM
Requery SubForm lizhaskin Access 1 November 28th, 2005 02:19 PM
requery subform bpete Access VBA 5 March 30th, 2004 09:31 AM
SubForm Requery ppenn Access VBA 2 August 7th, 2003 02:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.