Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
acDataForm v acForm
Colin Eastaugh 
     
16 months ago
Is there any difference between this command - DoCmd.GoToRecord acDataForm, "frmInstaX", acLast

and the following command - DoCmd.GoToRecord acForm, "frmInstaX", acLast ?

The only text difference is replacing acDataForm with acForm.

Just curious.  Both seem to work.
Allen Stanbury  @Reply  
      
16 months ago
Here is what copilot says "There is no functional difference between using acForm and acDataForm in the DoCmd.GoToRecord method. Both constants refer to forms, and they are interchangeable in this context."  "...the result will be the same: the code will navigate to the last record in the form named "frmInstaX""  Sounds about right but Copilot has had the occasional hallucination when I have asked it to write VBA code for me. An example: Copilot wrote a stack for me, complete with Push & Pop functions based on the non-existent Screen.PreviousForm. When the code refused to compile, I viewed Richards item on trapping the name of the previous for in the Form_Open event.  Richard said there was no such command.  Pointing that out to Co-Pilot returned: "You are right! My apologies for the confusion. In Microsoft Access VBA, there is no Screen.PreviousForm property."  On the other hand it has been bang for most (simple) things.
Richard Rost  @Reply  
          
16 months ago
Yeah, it's really good at taking tedious programming jobs and writing quick code for you, but I would only use it for stuff that I already know how to do. Like, I can say real quick, make me a short routine to get a value from a website, and it'll crank that out no problem. But always make sure you fully test it and don't believe everything it says. And if something is not working right assume it doesn't know what it's doing LOL.
Richard Rost  @Reply  
          
16 months ago
BTW, here's what GPT says. I've usually found that GPT is smarter than Copilot or Gemini when it comes to MS Access stuff (probably because I've been feeding it all of my stuff. LOL. JK.)

Yes, there is a difference between `acForm` and `acDataForm` in Microsoft Access.

- acForm (value: `2`): This is used with commands like `DoCmd.OpenObject` when referring to a general form object. It is typically used to open, close, or manipulate forms within the database.

- acDataForm (value: `2`): This is used with `DoCmd.TransferDatabase` to indicate that the object being transferred is a form. It specifically refers to forms when importing, exporting, or linking objects between databases.

Even though both constants have the same numerical value (`2`), they are used in different contexts. `acForm` is for general form-related commands, while `acDataForm` is specifically for transferring forms between databases.
Richard Rost  @Reply  
          
16 months ago
So basically... it's the same thing. Both convert to the number 2.
Colin Eastaugh OP  @Reply  
     
16 months ago
Touch of the forelock to Allen and of course Richard, and a nod in the direction of Copilot, ChatGPT and Gemini.

Many thanks for the quick replies, much appreciated.
Allen Stanbury  @Reply  
      
15 months ago
Thanks Richard!  Great work finding the real answer.  Good advice on using GPT over Copilot for Access stuff.  I created a situation like this in my last app.  I use a table listing positions a player can play.  The PositionID is used is used in two tables: ScoresT shows the position actually played on that day and the FK is named also naned PositionID but in PlayerT I changed the FK field name to PreferredPositionIID because the same values can have different meanings.  And I need to learn how to put blank lines between paragraphs!

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/7/2026 5:25:07 AM. PLT: 1s