Solved

Runtime error 2101.  The setting you entered isn't valid for this property

Posted on 2006-10-19
2
1,185 Views
Last Modified: 2008-03-17
Hi,

I have Mousedown event (on an option button) where it
1) calls a dialog form (to load a fire)
2) waits for the form to be closed (via Do Events)
3) and then depending if the user did load a file or canceled, enable/disable all option buttons (including this one)

However, i receive runtime 2101 when it executes the 1st line after the else statement below:
Me!opbFileLoad.Enabled = False

Effectively, since the file was loaded, I do not need to enable the "Load File" option button anymore (opbFileLoad).

Any ideas?


Private Sub opbFileLoad_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
   '1. Open Dialog box to load file
   DoCmd.OpenForm "SelectFile", , , , , , _
   "Load,Application Journal,FileAttachment,Application Journal,ApplicationJournalId," & Me![txtApplicationJournalId] & _
   ",FileName,Job Application Journal"
   '0 = Action, 1 = Form, 2 = Target field, 3 = Table, 4 = Search field, 5 = Search value
   '6 = Table FileName field, 7 = Optional Mainform (for triggering save records
   '                                                 prior to loading)
   While SysCmd(acSysCmdGetObjectState, acForm, "SelectFile") <> 0
      DoEvents
   Wend
   
   'Update option button choices depending on result from above (eg. if user selected
   'a file or not
   If IsNull(Me![FileName]) Then 'No file was chosen
      Me!opbFileLoad.Enabled = True
      Me!opbFileViewEdit.Enabled = False
      Me!opbFileDelete.Enabled = False
   Else 'File was chosen
      Me!opbFileLoad.Enabled = False
      Me!opbFileViewEdit.Enabled = True
      Me!opbFileDelete.Enabled = True
   End If
End Sub
0
Comment
Question by:ngekas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 44

Expert Comment

by:Leigh Purvis
ID: 17763942
Although the error isn't referring to as much - you can't disable a control that has the focus on a form.
0
 
LVL 39

Accepted Solution

by:
stevbe earned 125 total points
ID: 17765230
so to go along with what LPurvis posted ... add a SetFocus to a control that is enabled before disabling the FileLoad control ...

   Else 'File was chosen
      Me!opbFileViewEdit.Enabled = True
      Me!opbFileViewEdit.SetFocus
      Me!opbFileDelete.Enabled = True
      Me!opbFileLoad.Enabled = False
   End If
End Sub

Steve
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question