473,326 Members | 2,108 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Requery not working

102 64KB
Background: Front end- MS Access 2010/VBA, Back end- MS SQL Server 2008

I get the following error when I execute this command:
Expand|Select|Wrap|Line Numbers
  1.  With rstDB
  2.      .AddNew
  3.  
  4.         .Fields("Associate") = Me.fAssociate.Value
  5.         .Fields("Date") = Me.fDate.Value
  6.         .Fields("Project") = Me.fProject.Value
  7.         .Fields("Associate") = Me.fAssociate.Value
  8.         .Fields("Status") = status
  9.         .Fields("StatusDate") = Now()
  10.         .Fields("Notes") = Me.fNotes.Value
  11.         .Fields("md_DateTime") = datex
  12.         .Fields("md_Action") = "A"
  13.         .Fields("md_User") = gblUser
  14.  
  15.      .Update
  16.    End With
  17.  
  18.    rstDB.Close
  19.    dbsDB.Close
  20.  
  21.    Set rstDB = Nothing
  22.    Set dbsDB = Nothing
  23.  Forms![MyOpen_I].Form.Refresh
  24.  Forms![MyOpen].[MyOpen subform].Form.Requery
  25.  
Run-time error '2465'. Microsoft Access can't find the field '|1' referred to in your expression.

The error is with line 24. Thanks.
Mar 4 '15 #1
1 3024
twinnyfo
3,653 Expert Mod 2GB
Trye this:

Expand|Select|Wrap|Line Numbers
  1. Forms![MyOpen].Form.[MyOpen subform].Form.Requery
Mar 4 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Uwe Range | last post by:
Hi to all, I am working on a form with a combi-field on a subform. I want to give the user the opportunity to alter the list-content (which is based on a table) in a separate form. The user...
2
by: amywolfie | last post by:
I have read the other posts on this topic, but didn't find an answer specific to what I need. I have a main form: frmFeeInput, which contains 2 subforms: 1) sfrmFootnotes 2) sfrmLoanProducts ...
20
by: MS | last post by:
Access 97 I want to requery the data being displayed on a form, then I want to return to the record I was in. Why doesn't this code work? Private Sub CmdRefsh_Click()
14
by: Kurt | last post by:
I have an unbound main form with an unbound subform. frmProjects fsubProjectList Using combo boxes, the user can select several search criteria on frmProjects and then click a command button....
12
waynetheengineer
by: waynetheengineer | last post by:
Hi, I have a combo box on a form with a list of cities in it based on a single field city table. I also have a command button on this form that opens up another form that allows the user to enter...
4
by: aaronyoung | last post by:
I have created custom navigation buttons and Record Number indicators on several forms that are used to review and update records based on a query. My On Current event to update the "Record X of...
2
by: bbatson | last post by:
Hello, I have created a form that allows the user to search a sales table with the option to choose 1) a sales representative and 2) a car type matching any portion of the inputted text. For...
1
by: Simon van Beek | last post by:
Dear reader, After same changes it is required to requery (refresh) query in a sub form. The code below is not working:
6
by: deewe | last post by:
Hello, On an LostFocus event I'm trying to update another field that is tied to a DLookUp query. I'm able to update all the form fields but I don't find a way to update only one field. The...
24
by: MLEBL | last post by:
I'm creating a scheduling application for a hospital department that indicates when they've exceeded the minimum required staff for a particular shift. I have a table keeping track of the count and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.