-
WSaral
AskWoody LoungerI do not know, you may be right,but it works with updating and also in all other cases. I cannot explain myself why my command does not delete.Also,my command does not work or delete with a linked table even in the current database. It works only when the table is imported and not linked. Why is it so, and how can i remedy it?
Best Regards
-
WSaral
AskWoody LoungerThank you for your advices.I think i owe you an appreciation for the advices you have given.After your reply i have made a code
that really works.it is the following
Me![CmdDeleteInvoice].Caption = ” Invoice number ” & Forms![FOrderInformation]!.Value & ” has been updated.”And there the number of the invoice can be seen.I want to that you for that.
regards
-
WSaral
AskWoody LoungerThank you for your advices.I think i owe you an appreciation for the advices you have given.After your reply i have made a code
that really works.it is the following
Me![CmdDeleteInvoice].Caption = ” Invoice number ” & Forms![FOrderInformation]!.Value & ” has been updated.”And there the number of the invoice can be seen.I want to that you for that.
regards
-
WSaral
AskWoody LoungerDear Hans,
Thank you very much for your reply. I have used your code and you are right, i receive no error, but again the problem persists and the combo box customerid appears not in a new record, but with the number of the customer whose order i have opened. Once again, how i proceed. First, i choose an order from the list box,then i click the label above the list box with the following event:
Dim stLinkCriteria As String
Dim stDocName As String
stDocName = “Invoice”
stLinkCriteria = “orderid = ” & Me!.RequeryHowever in that case the form is not clear.In order to be clear the form i have to close it manually, or click on the control with the following code :
DoCmd.GoToRecord acDataForm, Me.Name, acNewRec
Customerid.SetFocusBut why this code is no longer valid in my first code? By the way, in the OnOpen event of the form i also have the same code:
DoCmd.GoToRecord , , acNewRec
Customerid.SetFocusMy question is, is there any way to make the combo box customerID be on a new record.Maybe the fault is with the list box called ListOrders. But again, the Command ListBox.Value = Nothing
gives no result. Maybe the form is not closed properly in the OnClose event of the report ?Best Regards
-
WSaral
AskWoody LoungerDear Hans,
Thank you very much for your reply. I have used your code and you are right, i receive no error, but again the problem persists and the combo box customerid appears not in a new record, but with the number of the customer whose order i have opened. Once again, how i proceed. First, i choose an order from the list box,then i click the label above the list box with the following event:
Dim stLinkCriteria As String
Dim stDocName As String
stDocName = “Invoice”
stLinkCriteria = “orderid = ” & Me!.RequeryHowever in that case the form is not clear.In order to be clear the form i have to close it manually, or click on the control with the following code :
DoCmd.GoToRecord acDataForm, Me.Name, acNewRec
Customerid.SetFocusBut why this code is no longer valid in my first code? By the way, in the OnOpen event of the form i also have the same code:
DoCmd.GoToRecord , , acNewRec
Customerid.SetFocusMy question is, is there any way to make the combo box customerID be on a new record.Maybe the fault is with the list box called ListOrders. But again, the Command ListBox.Value = Nothing
gives no result. Maybe the form is not closed properly in the OnClose event of the report ?Best Regards
-
WSaral
AskWoody LoungerDear Hans,
A few words of what i have done.today I have built a control on the form with the following code in the OnClick event:
DoCmd.GoToRecord , , acNewRec
Customerid.SetFocusIt works, the combo box CustomerID is cleared.But i want to do it automatically,on opening the report,and not by clikcing on a control.
However,if i put these lines in my function, i receive
Runtime error 2499 and the message “You can’t use the GoTorecord method in Design viewWithout the 2 lines of code the form is being opened and stays with customer under question. It is not clear.
With these 2 lines, as shown below,i receive the message that i cant use the GoTo method :Dim stLinkCriteria As String
Dim stDocName As String
stDocName = “Invoice”
stLinkCriteria = “orderid = ” & Me!
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
DoCmd.GoToRecord , , acNewRec
Customerid.SetFocus -
WSaral
AskWoody LoungerThank your for yor reply and concern indeed.
CustomerId is a combo box.Each time the form opens,it is opened with a new orderid.Then the next step is to choose a customer from the combo box
CustomerID.On that same form i have a list box to view the already given orders. When i choose an order from the list box, i open the report Invoice.
On closing the report invoice and opening the form again, i receive this problem. But the problem aqppear onlky when i use the list box, otherwise
when i issue a normal order, everything is ok and the form opens normally.So i think i need a way to clear the form from my choice of an order from the list box
The list box is called Listrders.Best regards
-
WSaral
AskWoody LoungerThank your for yor reply and concern indeed.
CustomerId is a combo box.Each time the form opens,it is opened with a new orderid.Then the next step is to choose a customer from the combo box
CustomerID.On that same form i have a list box to view the already given orders. When i choose an order from the list box, i open the report Invoice.
On closing the report invoice and opening the form again, i receive this problem. But the problem aqppear onlky when i use the list box, otherwise
when i issue a normal order, everything is ok and the form opens normally.So i think i need a way to clear the form from my choice of an order from the list box
The list box is called Listrders.Best regards
-
WSaral
AskWoody LoungerThank you for your reply.
The Control Source of the form is :
SELECT DISTINCTROW Orders.orderid, Orders.customerid,
Orders.orderdate, Orders.[required date], Orders.freigth,
Customers.CompanyName, Customers.employee,
Customers.address, Customers.city, Customers.taxid, Orders.PaymentMethodID, Orders.bankid, Bank.bankname, Bank.account, Bank.affiliate, Bank.bankaddress, Bank.bankcity, Customers.kindid, Orders.AuftragNr, Customers.afid, Orders.paymentid, Orders.invoicedate FROM Customers INNER JOIN (Bank INNER JOIN Orders ON Bank.bankid = Orders.bankid) ON Customers.Customerid = Orders.customerid;
The Row Source of the CustomerID is :
SELECT customers.* FROM customers WHERE (((customers.afid)=1)) ORDER BY customers.CompanyName;Best regards
-
WSaral
AskWoody LoungerThank you for your reply.
The Control Source of the form is :
SELECT DISTINCTROW Orders.orderid, Orders.customerid,
Orders.orderdate, Orders.[required date], Orders.freigth,
Customers.CompanyName, Customers.employee,
Customers.address, Customers.city, Customers.taxid, Orders.PaymentMethodID, Orders.bankid, Bank.bankname, Bank.account, Bank.affiliate, Bank.bankaddress, Bank.bankcity, Customers.kindid, Orders.AuftragNr, Customers.afid, Orders.paymentid, Orders.invoicedate FROM Customers INNER JOIN (Bank INNER JOIN Orders ON Bank.bankid = Orders.bankid) ON Customers.Customerid = Orders.customerid;
The Row Source of the CustomerID is :
SELECT customers.* FROM customers WHERE (((customers.afid)=1)) ORDER BY customers.CompanyName;Best regards
-
WSaral
AskWoody LoungerThank you very much for your reply.I receive the following message
invalid use of ‘.’,’!, or ‘(), in query expression
‘T.[customerid]=customers1].[customerid]’.
I cal the function in the following way :
AppendToTable “customers1”, “customers”, “customerID”
May be the wau i call the function is not right ?
Thank you in advance for your reply
Best regards
-
WSaral
AskWoody LoungerThank you so much indeed !!!!!!!!!!!!!!!!
-
WSaral
AskWoody LoungerThank you so much for your kind reply.It is true that the field CallId is not updated.I The two tables are absolutely identical in a sense that
the source table and the target table contain the same fields.Having this in mind, that the Callid is not updated, and that the two
tables contain the same fields, can you recommend a formula for updating the fields, or may be this is not possible ?Best regards
-
WSaral
AskWoody LoungerI feel obliged to let you know that the code suggested by you works now!! I did not cooy your suggestion in the right way
but i have copied again and it is excellent !!!!!!!!!!!Best regards
-
WSaral
AskWoody LoungerThank you very much indeed for your reply.I have tried your suggestion but i must have missed something since i get the Run Time error 91 namely ” “Object Variable or With block variable not set “. Could you check up my function again to find where my error is ?
Here is the function:
Function DeleteAll()
Dim dbs As DAO.Database
Dim tdf As DAO.TableDef
Dim i As Integer
Set dbs = CurrentDb‘ Loop backwards through relations
For i = dbs.Relations.Count – 1 To 0 Step -1
dbs.Relations.Delete dbs.Relations(i).Name
Next i‘ Loop backwards through tabledefs
For i = dbs.TableDefs.Count – 1 To 0 Step -1
If Left(tdf.Name, 4) “MSys” Then
dbs.TableDefs.Delete dbs.TableDefs(i).Name
End If
Next iSet dbs = Nothing
End FunctionBest Regards
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
*Some settings are managed by your organization
by
rlowe44
2 hours, 54 minutes ago -
Formatting of “Forward”ed e-mails
by
Scott Mills
5 hours, 8 minutes ago -
SmartSwitch PC Updates will only be supported through the MS Store Going Forward
by
PL1
5 hours, 33 minutes ago -
CISA warns of hackers targeting critical oil infrastructure
by
Nibbled To Death By Ducks
14 hours, 33 minutes ago -
AI slop
by
Susan Bradley
13 hours, 44 minutes ago -
Chrome : Using AI with Enhanced Protection mode
by
Alex5723
15 hours, 50 minutes ago -
Two blank icons
by
CR2
1 hour, 23 minutes ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
1 day ago -
End of 10
by
Alex5723
1 day, 3 hours ago -
Single account cannot access printer’s automatic duplex functionality
by
Bruce
1 hour, 19 minutes ago -
test post
by
gtd12345
1 day, 9 hours ago -
Privacy and the Real ID
by
Susan Bradley
23 hours, 32 minutes ago -
MS-DEFCON 2: Deferring that upgrade
by
Susan Bradley
15 hours, 39 minutes ago -
Cant log on to oldergeeks.Com
by
WSJonharnew
1 day, 13 hours ago -
Upgrading from Win 10
by
WSjcgc50
1 hour, 28 minutes ago -
USB webcam / microphone missing after KB5050009 update
by
WSlloydkuhnle
5 hours, 2 minutes ago -
TeleMessage, a modified Signal clone used by US government has been hacked
by
Alex5723
2 days, 5 hours ago -
The story of Windows Longhorn
by
Cybertooth
1 day, 17 hours ago -
Red x next to folder on OneDrive iPadOS
by
dmt_3904
2 days, 7 hours ago -
Are manuals extinct?
by
Susan Bradley
1 hour, 5 minutes ago -
Canonical ditching Sudo for Rust Sudo -rs starting with Ubuntu
by
Alex5723
2 days, 16 hours ago -
Network Issue
by
Casey H
2 days, 3 hours ago -
Fedora Linux is now an official WSL distro
by
Alex5723
3 days, 4 hours ago -
May 2025 Office non-Security updates
by
PKCano
3 days, 4 hours ago -
Windows 10 filehistory including onedrive folder
by
Steve Bondy
3 days, 6 hours ago -
pages print on restart (Win 11 23H2)
by
cyraxote
2 days, 7 hours ago -
Windows 11 Insider Preview build 26200.5581 released to DEV
by
joep517
3 days, 9 hours ago -
Windows 11 Insider Preview build 26120.3950 (24H2) released to BETA
by
joep517
3 days, 9 hours ago -
Proton to drop prices after ruling against “Apple tax”
by
Cybertooth
3 days, 16 hours ago -
24H2 Installer – don’t see Option for non destructive install
by
JP
1 hour, 34 minutes ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.