473,789 Members | 2,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Requery skip to a New Entry ?

134 New Member
I have an Invoice form that consist of main form and a sub form.
Main form consist of customer address and contact...etc

Sub form is a continue form for item purchase.
I have an unbound field - txtfreight, every time I enter an amount into the txtfreight, this Problem drive me nut -

In the Afterupdate event on line 1 and line 2, I am trying to update the
unbound txtfreight onto the field "freight", (1) but it never write or update to
the field - freight ?

So I need to trigger the requery on line 7, this time it write or update the
field -freight, (2) but the entire form become blank, because it skip to a new
form entry ? I have set the form property - Data Entry = No.

Does anyone know what the problem with the coding



Private Sub txtfreight_Afte rUpdate()

1. Forms.frmctmlet ter.freight = Forms.frmctmlet ter.frmCtmLines .Form.txtFreigh t
2. DoCmd.RunComman d acCmdSaveRecord
3.
4.
5.
6. If Me.txtamt > 0 Then
7. Forms.frmctmlet ter.Requery
8. End If
Jan 3 '08 #1
2 1197
puppydogbuddy
1,923 Recognized Expert Top Contributor
I have an Invoice form that consist of main form and a sub form.
Main form consist of customer address and contact...etc

Sub form is a continue form for item purchase.
I have an unbound field - txtfreight, every time I enter an amount into the txtfreight, this Problem drive me nut -

In the Afterupdate event on line 1 and line 2, I am trying to update the
unbound txtfreight onto the field "freight", (1) but it never write or update to
the field - freight ?

So I need to trigger the requery on line 7, this time it write or update the
field -freight, (2) but the entire form become blank, because it skip to a new
form entry ? I have set the form property - Data Entry = No.

Does anyone know what the problem with the coding



Private Sub txtfreight_Afte rUpdate()

1. Forms.frmctmlet ter.freight = Forms.frmctmlet ter.frmCtmLines .Form.txtFreigh t
2. DoCmd.RunComman d acCmdSaveRecord
3.
4.
5.
6. If Me.txtamt > 0 Then
7. Forms.frmctmlet ter.Requery
8. End If

Three things:
1. if txtfreight is calculated rather then entered, the afterUpdate event will never fire. So if txtFreight is calculated, place your code in the Form_BeforeUpda te event of your subform.
2. Forms!frmctmlet ter!freight.Val ue = Forms!frmctmlet ter!frmCtmLines .Form!txtFreigh t
3. Change "requery" to "recalc". Requery does change the record pointer.
Jan 3 '08 #2
jamesnkk
134 New Member
Three things:
1. if txtfreight is calculated rather then entered, the afterUpdate event will never fire. So if txtFreight is calculated, place your code in the Form_BeforeUpda te event of your subform.
2. Forms!frmctmlet ter!freight.Val ue = Forms!frmctmlet ter!frmCtmLines .Form!txtFreigh t
3. Change "requery" to "recalc". Requery does change the record pointer.
Wow ! It works to what I expect, I don't even know a command "recalc", thank you so much Master !!! ....You are powerful ! And you light up my life.
Jan 3 '08 #3

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

Similar topics

1
2995
by: M Wells | last post by:
Hi All, I am developing an Access 2003 project application with the back end in SQL Server 2003. I have a master form that tracks projects, and several subforms on it that track various aspects of the project. On the masterform I have two unbound listboxes that I populate with information regarding the current record in one of the subforms.
4
7018
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the user enters the last qualifying field on the main form. In one case this works fine, the subform shows the data the user wants to update -- which means showing all the data put in previously (ie showing this via the requery and the continuous...
3
12831
by: ken | last post by:
Hi, I have a main form with a text box and a filter button. I also have a subform in the main form. When I make an entry into the filter text box and click the filter button, I change the query definition of the subform and then try to requery the subform, but no matter what I do it does not requery? While my main form is open and after I clicked on filter, I can open the subform query and see that the sql changed correctly. I can open...
6
9983
by: Mark | last post by:
Hello. I have a listbox whose rowsource is set to a saved query (call it "qry_customer_list.") When I add customers to my database, I call the listbox Requery method so that the listbox will display the customers that I added. Unfortunately, the listbox display does not change. If I close the form and reload it, then the listbox will show the new customers. Any suggestions on how to fix this?
6
7989
by: MarkoBBC | last post by:
Hi everyone, First a brief description of my form: I have a subform within a main form. In my subform, I have a listbox displaying address information by firm name. A user first has to select a firm name in a combo box above the list box. The listbox and the combo box join on firm name. The listbox records what address was selected in the address table by the way of an address id number. I set up a macro to requery the listbox when you...
2
1923
by: Swinky | last post by:
Can someone explain to me the proper syntax for requery and where to input it in my form? I have a main form "Account-Master" with two subforms: 1.) Contacts and 2.)TNotes. The TNotes subform has a list of notes related to the Account-Master record (a relationship has been established based on the field CompanyID which exists in both tables).
10
1919
by: jp | last post by:
I have multiple PMW widgets (EntryFields, ScrolledField etc), how can I skip over these widgets when using the tab key? Thank you, John
4
2070
theaybaras
by: theaybaras | last post by:
Hi All... I've read both of the requery discussions I could find... Refresh ComboBox After Adding New Values via a Seperate Form and refresh a form but am not quite able to get this to apply to my database. I have a table/form called Author_Info where information about authors is entered. The fields of interest here are: Author_Last Author_First
31
6683
by: matthewslyman | last post by:
I have an unusual design and some very unusual issues with my code... I have forced Access to cooperate on everything except one issue - record deletion. My form design involves a recursively nested form. In other words, the form, m_settings_menueditor_recursive has a single subform; m_settings_menueditor_recursive (both are viewed as datasheets - so the form is its own subdatasheet.) The Form_Open event modifies the form's recordset so...
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9984
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9020
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3701
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.