Results 1 to 9 of 9
  1. #1
    Join Date
    Aug 2006
    Posts
    126

    Unanswered: Unbound form/control and hiding the form

    I am designing a db in MS Access 2003. The db will be multiuser, so the opening form is to be a single unbound field that will select which user. Once the selection is made, the form will be hidden, so the selection can be used for the duration of the session. Each query will use the selection to limit the data to the particular subset. For some reason, when the form opens it allows the single combobox to display the selections, but will not accept any input.

    The parameters of the form are:
    Name: fDistrictSelectDialog
    Record Source: blank
    Single form
    Data Entry = Yes
    Record Select = No
    ScrollBars = No
    NavButtons = No
    Popup = No
    Modal = No
    MinMax = No
    CloseButton = No

    The parameters of the ComboBox are:
    Name: cDistrictSelectBox
    Control Source: blank
    RowSourceType = table/query
    RowSource = SELECT qDistrictNamesAlpha.DistrictName FROM qDistrictNamesAlpha;
    ColumnCount = 1
    ListRows = 12
    Limit to List = Yes
    Visible = Yes
    Enabled = Yes
    Locked = No
    OnExit : mMainMenuMacro.HideDistrictSelect (this is a question)

    Once I get this form to accept data, then the next question is which On-event to use to trigger the "hide" when the person has either typed enough of the selection and hit Enter or has clicked on one entry in the combobox?

    Last question is, since the Visible parameter is not shown in the form properties, what should the macro "HideDistrictSelect" specify. [I assume it is something like RunCommand: Set form![fDistrictSelectDialog].Visible="False"] However, that doesn't seem to be the right format.

    The AutoExec macro has:
    OpenForm fDistrictSelectDialog DataMode=Edit; WindowMode=dialog
    RunCommand ???hide the form???
    OpenForm fMainMenu DataMode=Edit; WindowMode=Normal
    GotoControl {first field of form}

    I hope I've given enough info for the 3 questions.
    Pete Townsend
    PGT

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    yet another attempt to recreate a userid

    anything against using the windows network logon (see the code bank, or search for Dev Asish API calls)
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Aug 2006
    Posts
    126
    Sorry you feel that way. No this is not an attempt to recreate the userid. And network logon is in use.
    PT
    PGT

  4. #4
    Join Date
    Aug 2009
    Location
    Up Nort' Wi
    Posts
    140
    Not real sure I'm completely understanding what you're looking for (It's being a long day) but, this is how I *think* I'd tackle your issues.

    First: I would eliminate the Macros, there's nothing you can do with a Macro you can't do behind the scenes with code (usually a lot cleaner with less breakdowns..but that's just me)

    Second, getting the Combobox to accept the input.

    I would use the AfterUpdate Event to fire your code.

    Code:
    cDistrictSelectBox_AfterUpdate
    
    	if not isnull(cbo_cDistrictSelectBox) then
    		if msgbox("YourQuestion", vbyesno + vbquestion, "QuestionTitle") = vbyes then
    			do something
    		end if
    	end if
    
    end sub
    That should actually take care of Questions 1 & 2 if I'm following properly.

    To hide a form, the Visible property is correct. There's numerous ways to do that in code:

    Me.Visible = False
    Form_fDistrictSelectDialog.Visible = False

    As a caveat: you will need to make sure you have another form open and set the focus to something on the open form before Access will allow you to hide your current form.

    Sam, hope I'm somewhere in the ballpark for ya.
    Good, fast, cheap...Pick 2.

  5. #5
    Join Date
    Aug 2006
    Posts
    126
    Sam,
    Thanks, I do like modules better than macro's but the guy that started this is hot on macro's so I'm not rocking the boat (yet! I've got 2 in so far).

    Thanks for clarifying the "hide form"; I thought using Visible was correct. And thanks for advice on using "afterupdate" rather than one of the others.

    Right now, my big problem is that when the unbound form w/ cbo opens, I can't type anything in the combobox nor can I click on any of the list the SELECT clause correctly shows. Since it doesn't recognize an attempt to update, nothing is stored in the variable, and it won't close, even manually. (I switch it to Design and then close it to get around the glitch).

    Many thnx,
    Pete
    PGT

  6. #6
    Join Date
    Aug 2009
    Location
    Up Nort' Wi
    Posts
    140
    Sorry for the delay, was stuck at a Dr. appt all day yesterday.

    That's truly bizarre, I've only had something like that happen once when the db was on the verge of corrupting.
    I would try removing the OnExit Event first, move it to the after update or just comment it out for testing. It may be interfering with its normal behavior.
    Have you done a decompile - recompile & compact/repair (Make sure to make a backup first...it can blow up).
    I would then recommend deleting the combobox and making a new one (It can even have the same name...Access has some quirks yet that just baffle me...) I've fixed a lot of wonky controls by just deleting them and replacing them with "fresh" ones, they seem to work fine from that point on.

    If that doesn't work, would it be possible to post up a copy of that form and its tables? (throw some junk data in for testing) so we can see what's going on? If possible convert it first to Access 2k.

    Sam, good luck!
    Good, fast, cheap...Pick 2.

  7. #7
    Join Date
    Aug 2009
    Location
    Up Nort' Wi
    Posts
    140
    Quick question...On your *form properties* is Allow Edits set to yes? If not, set it to yes and try it.

    Sam
    Good, fast, cheap...Pick 2.

  8. #8
    Join Date
    Aug 2006
    Posts
    126
    Also sorry for the delay. Hiloti trojan got past both of my scanners, and I was busy cleaning up the system. Allow Edits is No, so I'll try that first. Will try your other suggestions after. Thanks again for your ideas and time.

    Are we having fun yet?
    My picks = Good,cheap
    PGT

  9. #9
    Join Date
    Aug 2006
    Posts
    126
    I did a quick check and the Allow Edit seemed to work. I'll pursue this later after I straighten out another glitch from my "helper". That may be a separate post tomorrow or the next day.
    Thanks again
    PGT

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •