RE: button to switch forms?
- From: "Gary" <Gary@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 14 Dec 2005 16:51:02 -0800
I have a command button which opens another form which is bound to the same
table.
I create the second forms through the form wizard and include the fields I
need, which includes, in my case, the reference number.
When I place the command button on my original form I choose Form Operations
and Open Form.
It then asks which form to open (the new one), and then (this is the key)
whether to open the form and display all records or to open and find specific
data to display.
I choose sepcific data and it asks which fields have matching data. In my
case, I select reference no on both sides. It then finishes creating the
button as normal.
Now when I click that button from the first form it bring me to the new form
on the same record.
I know, I use too many words.
hth
Gary
"wacntn" wrote:
> I have two forms and I want the user to be able to switch back and forth
> between them. The forms use data from the same table and from only one
> table. I have a button working on one form to go to the other form and to
> 'stick' to the record the user is on. But, when I try to do this on the
> other form to go back, I get an error I can't track down following MS's
> directions. Here's my code for the button. The error follows.
>
> Private Sub Command2068_Click()
> On Error GoTo Err_Command2068_Click
>
> Dim stDocName As String
> Dim stLinkCriteria As String
>
> stDocName = "frmProject Portfolio Maintenance"
>
> stLinkCriteria = "[ProjectID]=" & "'" & Me![ID] & "'"
> DoCmd.Close
> DoCmd.OpenForm stDocName, , , stLinkCriteria
>
> Exit_Command2068_Click:
> Exit Sub
>
> Err_Command2068_Click:
> MsgBox Err.Description
> Resume Exit_Command2068_Click
>
> End Sub
>
> The following is in the msgbox that pops up when the button is clicked.
>
> The expression On Click you entered as the event property setting produced
> the following error:
> Procedure declaration does not match description of event or procedure
> having the same name.
>
> Procedure].
>
> * There may have been an error evaluating the function, event, or macro.
>
>
>
>
.
- References:
- button to switch forms?
- From: wacntn
- button to switch forms?
- Prev by Date: RE: Cbo Update Problems
- Next by Date: Re: How do I make make my form start from new entry
- Previous by thread: Re: button to switch forms?
- Next by thread: Re: How can I get data from previous record to repeat in new record?
- Index(es):