473,545 Members | 2,679 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Form Requery / Refresh problem

135 New Member
Hello,

I have a form with some buttons that take the user to reports, other forms, etc. On this form the user can see how many products are missing costing and pricing information, through some textboxes that i have designed with some code. The problem is that when the user opens another form, modifies products and comes back to the original form (which remains OPEN) the "status" of the missing products remain the same.

In other words, i cant find the way to refresh/requery the form and textboxes so that it checks again if products are missing. Ive tried different events with no luck...the missing products only reflect changes if the form is CLOSED AND OPENED again.

the current code is:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.  
  3. Me.costingmissingtxt.Requery
  4. Me.pricingmissingtxt.Requery
  5.  
  6. If Me.costingmissingtxt.Value >= 1 Then
  7. Me.missingtxt.Visible = True
  8. Me.missingtxt.ForeColor = 255:
  9. Me.costingmissingtxt.Visible = True
  10. Me.oktxt.Visible = False
  11. Me.costingmissingtxt.ForeColor = 255
  12. Me.missingtxt.Value = "MISSING:"
  13. Else
  14. Me.costingmissingtxt.Visible = False
  15. Me.missingtxt.Visible = False
  16. Me.oktxt.Visible = True
  17. Me.oktxt.ForeColor = 65280:
  18. Me.oktxt.FontBold = True
  19. Me.oktxt.Value = "OK"
  20. End If
  21.  
  22. If Me.pricingmissingtxt.Value >= 1 Then
  23. Me.missing2txt.Visible = True
  24. Me.missing2txt.ForeColor = 255:
  25. Me.pricingmissingtxt.Visible = True
  26. Me.ok2txt.Visible = False
  27. Me.pricingmissingtxt.ForeColor = 255
  28. Me.missing2txt.Value = "MISSING:"
  29. Else
  30. Me.pricingmissingtxt.Visible = False
  31. Me.missing2txt.Visible = False
  32. Me.ok2txt.Visible = True
  33. Me.ok2txt.ForeColor = 65280:
  34. Me.ok2txt.FontBold = True
  35. Me.ok2txt.Value = "OK"
  36. End If
Any ideas if the code is flawed or where to put it???
Thanks,
Gilberto
Oct 17 '07 #1
3 2631
puppydogbuddy
1,923 Recognized Expert Top Contributor
try>>> Me.Requery<<<<< on the Form_AfterUpdat e() event for the form (main form or actual subform (the source object, not the control) to which the selection is to be refreshed.
Oct 17 '07 #2
missinglinq
3,532 Recognized Expert Specialist
Just out of curiosity, how do you let the users know which fields need data? I use Conditional Formatting to change the BackColor to Red.

Linq ;0)>
Oct 17 '07 #3
Gilberto
135 New Member
Thanks guys, i used the ACTIVE event for the form, modified the code and it WORKED hahah.

Thanks for the replies. The code that worked is:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Activate()
  2. Me.Refresh
  3. Me.Requery
  4. Me.costingmissingtxt.Requery
  5. Me.pricingmissingtxt.Requery
  6.  
  7. If Me.costingmissingtxt.Value = 0 Then
  8. Me.missingtxt.Visible = False
  9. Me.missingtxt.ForeColor = 255:
  10. Me.missingtxt.Value = "MISSING:"
  11. Me.costingmissingtxt.Visible = False
  12. Me.costingmissingtxt.ForeColor = 255
  13. Me.oktxt.Visible = True
  14. Me.oktxt.FontBold = True
  15. Else
  16. Me.costingmissingtxt.Visible = True
  17. Me.missingtxt.Visible = True
  18. Me.oktxt.Visible = False
  19. Me.oktxt.ForeColor = 65280:
  20. Me.oktxt.Value = "OK"
  21. End If
  22.  
  23. If Me.pricingmissingtxt.Value = 0 Then
  24. Me.missing2txt.Visible = False
  25. Me.missing2txt.ForeColor = 255:
  26. Me.missing2txt.Value = "MISSING:"
  27. Me.pricingmissingtxt.Visible = False
  28. Me.pricingmissingtxt.ForeColor = 255
  29. Me.ok2txt.Visible = True
  30. Me.ok2txt.FontBold = True
  31. Else
  32. Me.pricingmissingtxt.Visible = True
  33. Me.missing2txt.Visible = True
  34. Me.ok2txt.Visible = False
  35. Me.ok2txt.ForeColor = 65280:
  36. Me.ok2txt.Value = "OK"
  37. End If
  38.  
  39. End Sub
Oct 17 '07 #4

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

Similar topics

4
8901
by: Kyralessa | last post by:
In Access 2000, I have a base form with a ListBox of conference registrants. In the form's declarations section I include Dim f as Form To add a registrant I'm doing this: Set f = New Form_frmSingleRegistrant f.Caption = "New Registrant" f.cmdSave.Caption = "&Save New Registrant"
2
2619
by: ColinWard | last post by:
Hi. I have a form which has as its recordsource an SQL string. The SQL String is as follows: SELECT * from CONTACTS where false. this ensures that there is no data loaded in the form when the form is opened. After the user selects the contact from an unbound combobox I want the form to be rebound to its recordsource. I tried using...
2
3562
by: Linda | last post by:
Hi, (Access 97) On my Menu form I have a button (cmdRefreshLinks) that refreshes/changes the linked tables in my database, and a calculated control (txtDataSource) that uses a custom function to display the location of the back-end database. (This is all done using Dev Ashish's 'Relink Tables' code from...
4
6911
by: deko | last post by:
I'm a little nervous about slamming my database with a dozen Update queries in a loop that all modify RecordSources of open forms. Will the use of DoEvents and/or a Sleep function ameliorate any risk involved in doing this? Should I include a Requery in the loop after executing each query? For example: For each varQry in...
2
3659
by: dkintheuk | last post by:
Hi all, Using Access 2000 on XP Pro PC. I have a form that is based on a presaved query - all fine with this. I also have a refresh button that takes the values from various unbound controls on the form and uses them a the criteria for changing the query definition that the form is based on - so far so good.
22
4993
by: Br | last post by:
First issue: When using ADPs you no longer have the ability to issue a me.refresh to save the current record on a form (the me.refresh does a requery in an ADP). We usually do this before calling up another form or report that uses some of the same data. We came up with a work around that saves the current record's ID, does a
2
8161
by: Robert | last post by:
I am trying to give the user dynamic search capabilities to select almost any record in the database from criteria they select. Everything seems to work except when I open the display form to display the data to the user. If that form is already open, how do I make it refresh its data source and display the new data. Here is what I am...
34
20117
by: bitsnbytes64 | last post by:
Hi, I've been having a similar issue to what is described in the "refresh a form" post with a ComboBox that is not being refreshed after adding a new value on a seperate form. The second form is being opened via the standard DoCmd call. I've tried adding Requery in AfterUpdate, Form_Current, etc. to no avail.... The test form has the...
5
17406
kcdoell
by: kcdoell | last post by:
Hello: I thought I was done with this one but a user who is testing my DB just pointed out a problem. I used the following in the afterupdate event: Private Sub Binding_Percentage_AfterUpdate() 'Updates the Total calculation in the control "SumGWP", Sum50GWP, "SUMNWP" and Sum50NWP 'on the quick reference table on the Forecast form.
0
7496
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...
0
7428
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...
0
7941
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...
1
7452
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5071
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3485
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1916
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1039
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
738
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...

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.