Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Page won't Requery

Posted on 2011-03-08
10
Medium Priority
?
318 Views
Last Modified: 2012-05-11
Experts,

I have a simple equations that if a text box equals zero value then the "Closed" check box equals true to show that the order is closed.  My issue is that this only works if the form is closed then re-opened. Say the order is 10 and we ship 5 and I leave the form open and ship the remaining 5 later in the day, the code won't work. Although if I ship 5 in the day close the form then re-open it later in the day the code works. I assume this is some kind of requery or refresh error. I've tried different variations of the requery and refresh without any luck.

Any suggestions on what I'm missing here?

If Me.[Text36] = 0 Then Me.Closed = True
0
Comment
Question by:NuclearOil
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 19

Expert Comment

by:MINDSUPERB
ID: 35069236
Try to put your code in the After Update Event of your Text36 field.

Sincerely,
Ed
0
 

Author Comment

by:NuclearOil
ID: 35069518
The code is attached to a command button. The button also prints the shipper.

No did't work, the code is under a command button too. I don't know if that makes a differece?
0
 
LVL 19

Expert Comment

by:MINDSUPERB
ID: 35069559

Try

If Me.[Text36].Value = 0 Then Me.Closed = True


Ed
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:NuclearOil
ID: 35069728
Nope, I have the format to general number too thinking that was the problem.
0
 
LVL 19

Expert Comment

by:MINDSUPERB
ID: 35069811
I assumed that Text36 is an unbound textbox by which its control source is a formula. Can you post the equation/formula?

Ed
0
 

Author Comment

by:NuclearOil
ID: 35070029
Text36=DisplayQty([Text40])
Text40 is the Quantity minus the total shipped from the subform.
[Quantity]-[ShipRecords subform].Form.Text12

The DisplayQty is a module I wrote to not have the #Error.

Text 40 is
0
 
LVL 11

Expert Comment

by:LambertHeenan
ID: 35070291
If you change the check box's control source to

=[Text36]=0

Then is will change whenever Text36 reaches zero.

This may be of use if the checkbox is only being used to display the closed status. If you also want to store the closed status back to the table then you will need a little code in the form's AfterUpdate event. THis is becuase using the above formula in the Control Source of the checkbox unbinds it from the table.
0
 

Author Comment

by:NuclearOil
ID: 35071447
LambertHeenan,

The code I am using is on a command button when clicked. When the operator pushes the button the computer is supposed to evaluate the results of Text36 and decide to close the check box which is in the table and needs to be stored.I'm confused on changing Text36 to = 0 in the control source?
0
 
LVL 8

Expert Comment

by:Andrew_Webster
ID: 35071510
I just spent some time playing with this, and Lambert's answer is spot on.

0
 
LVL 11

Accepted Solution

by:
LambertHeenan earned 2000 total points
ID: 35071540
If you display the properties of the check box, on the Data tab you will see the "Control Source" listed. If you enter the following in the property

=[Test36]=0

Then you should get the desired results.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question