Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old August 3rd, 2007, 04:04 PM
Registered User
 
Join Date: Aug 2007
Location: Kennewick, W, USA.
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!
Reply With Quote
  #2 (permalink)  
Old August 3rd, 2007, 04:39 PM
Friend of Wrox
Points: 513, Level: 8
Points: 513, Level: 8 Points: 513, Level: 8 Points: 513, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2007
Location: Davenport, IA, USA.
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

Reply With Quote
  #3 (permalink)  
Old August 6th, 2007, 03:35 PM
Registered User
 
Join Date: Aug 2007
Location: Kennewick, W, USA.
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...
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using saved query to do update kscase VB Databases Basics 0 June 7th, 2007 12:46 PM
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 03:00 AM



All times are GMT -4. The time now is 06:26 PM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.