UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Simulate Pressing F5 When A Form Opens To Remove #deleted, Access 2007    
 
   
Lateral
post Mar 26 2019, 11:44 PM
Post#1



Posts: 255
Joined: 29-November 13



Hi Guys

I have a continuous form called frmWebOrders.

It works perfectly.

Recently, I added some functionality that updates the underlying table (called WebOrders) by importing a CSV file. Prior to the import, I delete all records from the WebOrders table.

Sometimes when I reopen the frmWebOrders form, it is displaying #DELETED in the rows. If I press the F5 key, it fixes it and the new records are displayed.

All of my tables are linked (FE to BE).

I have tried adding the Me.Requery to various events (On Load, On Open etc) but I just can see to get it to work how I want it to.

So, my question is.....is there a way to simulate in VBA exactly the function that pressing the F5 key does?

Cheers
Greg
Go to the top of the page
 
theDBguy
post Mar 27 2019, 12:36 AM
Post#2


Access Wiki and Forums Moderator
Posts: 75,559
Joined: 19-June 07
From: SunnySandyEggo


Hi Greg. Requery should do the same thing as the F5 key, so it’s probably just a matter of finding the right place to do it.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
Phil_cattivocara...
post Mar 27 2019, 03:02 AM
Post#3



Posts: 279
Joined: 2-April 18



I have found this Access 2007/2010 #deleted record shows up but it's very common to find (googling) the same problem with Access FE and SQLServer as BE. Is this you situation? Are there more than one user connected at the same time?

--------------------
Please forgive in advance my horrible English.
Go to the top of the page
 
Lateral
post Mar 27 2019, 05:28 AM
Post#4



Posts: 255
Joined: 29-November 13



Hi Phil,

My BE is an Access BE.

Go to the top of the page
 
Minty
post Mar 27 2019, 05:49 AM
Post#5



Posts: 309
Joined: 5-July 16
From: UK - Wiltshire


Is your form based directly on the table or a query ?
And try Requery without the Me.

This thread explains the different methods http://www.UtterAccess.com/forum/Refresh-R...i-t2023533.html
Go to the top of the page
 
Lateral
post Mar 27 2019, 03:00 PM
Post#6



Posts: 255
Joined: 29-November 13



Hi Minty

I will try what you are suggestion and add just the Requery to the On Load event?

The form is based upon the following query:

SELECT Web_Orders.[Invoice Date], Customers.CustomerID, Customers.EmailAddress, Web_Orders.[Order No], Web_Orders.[First Name], Web_Orders.[Last Name], Web_Orders.Email, Web_Orders.[Product Reference], Web_Orders.[Product Qty], Web_Orders.[Total price tax incl], Web_Orders.[Product Name], Web_Orders.[Product ID], Web_Orders.[Order reference], Web_Orders.[Invoice No], Web_Orders.[Customer No], Web_Orders.[Delivery State], Web_Orders.[Total Paid Real], Customers.ContactFirstName, Customers.ContactLastName, Web_Orders.PartID
FROM Customers RIGHT JOIN Web_Orders ON Customers.EmailAddress = Web_Orders.Email
ORDER BY Web_Orders.[Invoice Date] DESC;
Go to the top of the page
 
AlbertKallal
post Mar 27 2019, 03:53 PM
Post#7


UtterAccess VIP
Posts: 2,813
Joined: 12-April 07
From: Edmonton, Alberta Canada


You would do the me.requery after you do the import or have re-set or changed the source of the continues form.

If you just launch the form after you import, then you note there is no problem. So the issue is that the form is likely open during the re-load and re-set of the forms data.

So, right have to import or make that change to the records is where/when you need to execute a me.Requery, or if this occurs in some other routine, then

forms!FormName.Requery would be used.

Regards,
Albert D. Kallal (Access MVP 2003-2017)
Edmonton, Alberta Canada
Go to the top of the page
 
tina t
post Mar 27 2019, 03:53 PM
Post#8



Posts: 5,957
Joined: 11-November 10
From: SoCal, USA


QUOTE
Recently, I added some functionality that updates the underlying table (called WebOrders) by importing a CSV file. Prior to the import, I delete all records from the WebOrders table.

well, this is somewhat OT, but remember that repeatedly deleting and re-adding records to a table will bloat your backend db. you'll want to keep an eye on that, or perhaps use an alternate solution like a temporary backend db that gets discarded and replaced before every update.

hth
tina

--------------------
"the wheel never stops turning"
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    20th June 2019 - 04:23 PM