By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,773 Members | 2,583 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,773 IT Pros & Developers. It's quick & easy.

Error 2467:Object closed or doesnt exist

P: 3
Hello there I am having the above error and need assistance promptly please, I am trying to create an activity log table which logs the activities of users within my database, it seems to be working but having an issue of cannot populating the user details in the log table saying the above error mentioned.

Here is my current script below, I know that it is a minor error but cant seem to get around it :(



Private Sub ok_Click()
txtUsername.SetFocus

If txtUsername = "user" And txtPassword = "Testing123" Then
MsgBox "Access Granted", vbInformation, "Test"
DoCmd.Close
DoCmd.openform "Main Menu"

Else

MsgBox "ERROR: Please check your login details and try again."

End If

TempVars("UserName").Value = Me.txtUsername.Value
Oct 17 '17 #1

✓ answered by PhilOfWalton

I believe your problem may be you don't say what you want to close.

Try
Expand|Select|Wrap|Line Numbers
  1.     DoCmd.Close acForm, Me.Name
  2.  
Phil

Share this Question
Share on Google+
3 Replies


Expert 100+
P: 634
Hi

I would hazard a guess that you need to put this statement
Expand|Select|Wrap|Line Numbers
  1. TempVars("UserName").Value = Me.txtUsername.Value
before DoCmd.Close !!??

MTB
Oct 17 '17 #2

PhilOfWalton
Expert 100+
P: 1,430
I believe your problem may be you don't say what you want to close.

Try
Expand|Select|Wrap|Line Numbers
  1.     DoCmd.Close acForm, Me.Name
  2.  
Phil
Oct 17 '17 #3

P: 3
Thank you Mike and Phil for your kind assistance. I did what you both advised and worked perfectly by putting the TempVars("UserName").Value = Me.txtUsername.Value in front of the DoCmd.Close statement and also added acForm, Me.Name next to DoCmd.Close statement. THANKS HEAPS !!!
Oct 17 '17 #4

Post your reply

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