Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form to enter contact name to open coantacts' form to edit info 1

Status
Not open for further replies.

PeggyBall

Technical User
Oct 30, 2006
19
US
Hello -

I am almost finished working on my first database which will contain information about 300-400 members :)

For the user to edit information (change of address, awards received, etc) from the switchboard, I would like for the user to be able to search for one or more records then open either that or those specific frmMemberDataEntry form/s. If one search produces more than one result (2 Smiths) then click on that full name to open contact form.

My thoughts are it would work like this:
From the switchboard click "Search"

Message box opens - "Would you like to edit one member or up to 10 member records"

Message box based on choice "Enter Members' Last Name" or "Enter Members Last Name" (with up to 10 text boxes)

Click "OK"

Opens the specific form or forms for editing

Return to main switchboard when finished.
 
Your users might find it a little tedious to type in 10 names. Have you considered separating this into a search and a pick, with say, a multiselect listbox? Have you any reason why the user cannot display all members and just navigate/search through them? Finally, here is another idea:
Choosing a record in a combo
thread702-1317810
 
Thanks.

Yes, I see your point. I set up a form with a combo box and command button. Choose member name (from tblMembers) then click cmdOpenMemberForm but the form opens blank (indicating 1 filtered). I want the user to select the name and click to open the members form to edit data.
 
What line of code are you using to open the members form in cmdOpenMemberForm?
 
[unbound]=[Forms]![frmSearch]![LastName]

I think my problem might be the "unbound" but...

Thank you for your help:)
 
That line will not open a form. What is the full code, please.
 
Well, I attached the above a macro to the command button (which is probably why this isn't working) so I'm guessing I need a module and I'm very lost. This seemed like an easy task but I'm over my head...
 
It would be possible to edit the macro, but adding code to open a form is quite easy, as there are wizards, and it is much easier to post code to fora like these. Once you have a little code, we can tamper with it if necessary, so you will be swimming in no time.

* Make sure that the member form opens normally, that is displaying record 1 of all records.
* Open the form in design view.
* Select a command button from the toolbox, making sure that the Wizard Wand is clicked.
* Choose Form Operations from the first list, Open Form from the second list and the click Next.
* Pick the members form from the form to open list and click Next.
* Choose 'Open the form and find specific data to display' and click Next.
* Select the name of the combo from the first list and LastName from the second list. Click Next.
* Choose the caption or picture that you want for your button and click next.
* Enter a suitable name for your command button, for example, cmdOpenForm, and click Finish.

You should now have some code to open the members form.

Let us go back and re-examine "Select the name of the combo from the first list and LastName from the second list."
This assumes two things, one, that the combo is set up with the bound column set to LastName and two, that you are happy for more than one record to be selected, if there is more that one match for LastName.
 
Hi Remou-
Ok - I have 2 forms: a Member Data Entry tabbed form and a search form which has a combo box and command button (following above direction.) When I choose the name from the combo box then click "Open Form" the form opens blank and shows 1 of 1 record (filtered) at the bottom. I want a separate form to link to the switchboard (depending on what the user wants to do, ie. edit forms or add forms).

Here is the code for the command button:

Private Sub cmdOpenMembersForm_Click()
On Error GoTo Err_cmdOpenMembersForm_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmMemberDataEntry"

stLinkCriteria = "[LastName]=" & "'" & Me![Combo11] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdOpenMembersForm_Click:
Exit Sub

Err_cmdOpenMembersForm_Click:
MsgBox Err.Description
Resume Exit_cmdOpenMembersForm_Click

End Sub

Thanks for your help :)
Peggy
 
If you mean you wish to open the form at a new record, you can use acFormAdd from the DataMode argument:

[tt]DoCmd.OpenForm "frmForm", , , , acFormAdd[/tt]
 
No, from the frmSearch, I want to click on member name form the combo box, click on cmdOpenMembersForm button and go directly to that persons frmMemberDataEntry so I can update information such as address or phone numbers.

Currently, when in the frmMemberDataEntry, I must scroll through each form until I reach the record I want to edit, then make the changes(address, phone number, etc.).
 
This code:
[tt]stDocName = "frmMemberDataEntry"

stLinkCriteria = "[LastName]=" & "'" & Me![Combo11] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria[/tt]

Should open a form showing the name selected in Me!Combo11. If that is not happening, please post the Row Source for Combo11.
 
Remou -

I finally got it working!!! You deserve 10 stars for helping me. Thanks :)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top