473,385 Members | 2,004 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,385 software developers and data experts.

Problem through REFRESH

I have made a form of Supplier Master, showing the details of one Supplier (LAST RECORD) at a time. That form has a button (Goods Details), which opens another form & shows what material is being supplied by that particular customer.



Private Sub GoodsDetails_Click()

Dim strDocName As String

Dim strLinkCriteria As String

strDocName = "ItemBank"

strLinkCriteria = "[DataBankID] = Forms![DataBank]![id]"

Me.Refresh

DoCmd.OpenForm strDocName, , , strLinkCriteria

End Sub



Whenever, I add a record of Supplier & click on button (Goods Details), it does not show the details of Supplier which I added, but the last record of Supplier before added.



In that case, there is only one option left to close the form & re-open to enter the goods details of supplier.



I have tried to amend the VBA by adding “ Me.REFRESH”, in OPEN/LOAD/ACTIVATE but it has no effect.



I shall be very grateful if anyone can help me to overcome this problem.



Thanking you,
Nov 5 '07 #1
2 1243
I have made a form of Supplier Master, showing the details of one Supplier (LAST RECORD) at a time. That form has a button (Goods Details), which opens another form & shows what material is being supplied by that particular customer.



Private Sub GoodsDetails_Click()

Dim strDocName As String

Dim strLinkCriteria As String

strDocName = "ItemBank"

strLinkCriteria = "[DataBankID] = Forms![DataBank]![id]"

Me.Refresh

DoCmd.OpenForm strDocName, , , strLinkCriteria

End Sub



Whenever, I add a record of Supplier & click on button (Goods Details), it does not show the details of Supplier which I added, but the last record of Supplier before added.



In that case, there is only one option left to close the form & re-open to enter the goods details of supplier.



I have tried to amend the VBA by adding “ Me.REFRESH”, in OPEN/LOAD/ACTIVATE but it has no effect.



I shall be very grateful if anyone can help me to overcome this problem.



Thanking you,
Try Me.Requery instead of refresh.

Refreshing records only updates the data that already exists in your datasheet or form. It doesn't reorder records, display new records, or remove deleted records and records that no longer meet specified criteria. To perform those tasks, requery the records.
Nov 5 '07 #2
Thanks for your reply.

Your suggestion seems to be O.Kay to add a new customer & simultaneously add corresponding Goods Detail.

But, there is a problem if we go to a particular record (existing) by searching & when we click Goods Detail button to view their part detail, it shows the detail of 1st record available in the database. It appears to be a problem with Me.REQUERY that goes to the top of record.

I have used Me.REQUERY before the following command but still wrong data shows.

strLinkCriteria = "[DataBankID] = Forms![DataBank]![id]"

It is requested to enlighten me to resolve this issue.




Try Me.Requery instead of refresh.

Refreshing records only updates the data that already exists in your datasheet or form. It doesn't reorder records, display new records, or remove deleted records and records that no longer meet specified criteria. To perform those tasks, requery the records.
Nov 12 '07 #3

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

Similar topics

0
by: Mvk | last post by:
Hello; I have a strange threading problem. Suppose I have the following subs in it: 1) Refresh() 2)
0
by: brian lanning | last post by:
As a public service, I'm posting the solution to a problem I had. The bizarre thing is that I think this should have created an error. Instead, it sort of worked, but not quite. Many are familiar...
10
by: tasmisr | last post by:
This is an old problem,, but I never had it so bad like this before,, the events are refiring when clicking the Browser refresh button. In the Submit button in my webform, I capture the server side...
1
by: ppatel | last post by:
Problem I have a problem with web image button control click event. The click event does not get trigger until it has not been clicked once or page refresh occures(which is fine). When click...
17
by: jensen bredal | last post by:
Hello, i'm struggling with a somehow badly understood session scenario. I provide acces to my pages based on form authentication using Session cookies. Som of my pages are supposed to be...
6
by: Doug | last post by:
I'm about to go nuts. I've got a VB.NET web app , utilizing frames(my 1st mistake). One of the frames is hidden and does a behind the scenes refresh, to keep the session alive. This works great...
12
by: Justin | last post by:
I can attach my code if anyone wants to see it however I'll try to ask my question with some mark up code first. I'm having a problem terminating my process while using DoEvents. For example: ...
0
by: grappeggia | last post by:
Hi everybody, I`m doing a project in which a microcontroller realises an A/D conversion of 8 channels and send then to the computer using the USB, over one serialport interface. On the PC, I`m...
10
by: amitabh.mehra | last post by:
Hi I havent used MQT before. Read the online tips and tutorials but none seems to give any hint for my problem. I have a base table (base_table) as: st varchar(25) default...
22
by: V S Rawat | last post by:
(bringing the discussion here for php.general) I am on xpsp3, wampserver 2.0, having apache 2.2.8, php 5.2.6, MySQL 5.0.51b. http://localhost/ is E:\wamp\www\ I have put the first php script...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.