Module/Macro Button for Switchboard

S

scott04

I have a database that is in use that uses a switchboard upon opening the
database. There are buttons on the switchboard that create a new record in
add form and another for edit an existing record. One of the fields i have
in the database is case#. Is there code i can use such that on the click of
the button the prompts me for a case number to take me to only that one case
number. I was thinking this is a better option than giving all records.
Thanks for any thoughts or suggestions.
Beetle replied
You could create a separate small popup form with an unbound textbox to input
a case # and a command button to open the case form based on that value. Then
you could have your switchboard open the popup form instead of the case form

I recently created a marco that opens my form then calls a module i created
that works as a find module. Below is the code from the module. Do you
think this will be a good alternative?
Function Find()
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
Exit_Find_Click:
Exit Function
Err_find_Click:
MsgBox Err.Description
Resume Exit_Find_Click
End Function
 
R

Ron2006

In line with the previous suggestions:

A) Create an unbound form (perhaps named "selectCaseNumberForm") that
has a combobox that has a query showing (and bound field) the case#
and whatever else would be useful to make sure that they have the
proper case #.

B) Button on this unbound form to then

docmd.openform "formname",,,, "[Case#fieldName] = " &
comboboxname
docmd.close acform "SelectCaseNumberForm"

1) I am not sure of the proper number of commas, you want it
to be when the WHERE shows up in the intellisense helps.
2) the close should close the form that contains the button
and the combobox
3) be sure to select acEdit as opposed to acNew in the
intellisense for the openform (or not select anything) for that
option.

C) Add a new button to the main menu to call this
"SelectCaseNumberForm" or change the one that shows all of the records
to call that instead of what it now calls.


Ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top