Hi
I have 3 forms "Work_in_progress", "Installations" and Warranty".
Form "Work_in_progress" is a continuous form that displays uncompleted
work, each line has a control "Update" when pressed it opens form
"Installations" which until recently was fine. We have now secured a contract
to carryout warranty repairs, which requires a different form to be completed
("Warranty").
The 3 forms has "Tbl_Customers" as their control source which has a field
"Job_Type" this would contain the following data "Installations or Warranty".
What I would like to achieve is that when the control "Update" is pressed it
will open either of the forms "Installations" or "Warranty" based on the data
in "Tbl_Customers" field "Job_Type".
Example -- When field "Job_Type" = "Warranty" form "Warranty" is opened
I have searched through the posts but cannot find a solution.
Can someone provide an answer.
Thanks
Bazmac
|
|
0
|
|
|
|
Reply
|
Utf
|
4/2/2010 12:26:03 AM |
|
You need to change the recordsource of the form to a query in order to add
the Job_Type to the form. Then you need to branch the code with an If ...
Then ... Else statement or a Select Case statement. Here's an aircode
snippet:
If Me.txtJob_Type = "Installantion" Then ' or the Job_TypeID
DoCmd.OpenForm "Form1",,, "JobID = " & Me.txtJobID
Else
DoCmd.OpenForm "Form2",,, "JobID = " & Me.txtJobID
End If
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access
"Bazmac" <Bazmac@discussions.microsoft.com> wrote in message
news:659ED65A-6434-46E0-9F3F-459985826914@microsoft.com...
> Hi
>
> I have 3 forms "Work_in_progress", "Installations" and Warranty".
>
> Form "Work_in_progress" is a continuous form that displays uncompleted
> work, each line has a control "Update" when pressed it opens form
> "Installations" which until recently was fine. We have now secured a
> contract
> to carryout warranty repairs, which requires a different form to be
> completed
> ("Warranty").
>
> The 3 forms has "Tbl_Customers" as their control source which has a field
> "Job_Type" this would contain the following data "Installations or
> Warranty".
>
> What I would like to achieve is that when the control "Update" is pressed
> it
> will open either of the forms "Installations" or "Warranty" based on the
> data
> in "Tbl_Customers" field "Job_Type".
>
> Example -- When field "Job_Type" = "Warranty" form "Warranty" is opened
>
> I have searched through the posts but cannot find a solution.
>
> Can someone provide an answer.
>
> Thanks
> Bazmac
|
|
0
|
|
|
|
Reply
|
Arvin
|
4/2/2010 1:38:50 AM
|
|
Arvin,
Thankyou for your quick reply I have tried your suggestion the outcome is
that "Warranty" is the only form to display regardless of job type chosen,
please find below the original on click procedure follwed by your suggestion.
Could you advise were the problem is in the code
Thanking You
Bazmac
Private Sub Update_Click()
On Error GoTo Err_Update_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Installation"
stLinkCriteria = "[JobNo]=" & "'" & Me![JobNo] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Update_Click:
Exit Sub
Err_Update_Click:
MsgBox Err.Description
Resume Exit_Update_Click
End Sub
Private Sub Update_Click()
On Error GoTo Err_Update_Click
Dim stDocName As String
Dim stLinkCriteria As String
'stDocName = "Installation"
'stLinkCriteria = "[JobNo]=" & "'" & Me![JobNo] & "'"
'DoCmd.OpenForm stDocName, , , stLinkCriteria
If Me.Job_Type = "Installantion" Then ' or the Job_TypeID
DoCmd.OpenForm "Installation", , , "[JobNo]=" & "'" & Me![JobNo] & "'"
Else
DoCmd.OpenForm "Warranty", , , "[JobNo]=" & "'" & Me![JobNo] & "'"
End If
Exit_Update_Click:
Exit Sub
Err_Update_Click:
MsgBox Err.Description
Resume Exit_Update_Click
End Sub
"Arvin Meyer [MVP]" wrote:
> You need to change the recordsource of the form to a query in order to add
> the Job_Type to the form. Then you need to branch the code with an If ...
> Then ... Else statement or a Select Case statement. Here's an aircode
> snippet:
>
> If Me.txtJob_Type = "Installantion" Then ' or the Job_TypeID
> DoCmd.OpenForm "Form1",,, "JobID = " & Me.txtJobID
> Else
> DoCmd.OpenForm "Form2",,, "JobID = " & Me.txtJobID
> End If
> --
> Arvin Meyer, MCP, MVP
> http://www.datastrat.com
> http://www.accessmvp.com
> http://www.mvps.org/access
>
>
> "Bazmac" <Bazmac@discussions.microsoft.com> wrote in message
> news:659ED65A-6434-46E0-9F3F-459985826914@microsoft.com...
> > Hi
> >
> > I have 3 forms "Work_in_progress", "Installations" and Warranty".
> >
> > Form "Work_in_progress" is a continuous form that displays uncompleted
> > work, each line has a control "Update" when pressed it opens form
> > "Installations" which until recently was fine. We have now secured a
> > contract
> > to carryout warranty repairs, which requires a different form to be
> > completed
> > ("Warranty").
> >
> > The 3 forms has "Tbl_Customers" as their control source which has a field
> > "Job_Type" this would contain the following data "Installations or
> > Warranty".
> >
> > What I would like to achieve is that when the control "Update" is pressed
> > it
> > will open either of the forms "Installations" or "Warranty" based on the
> > data
> > in "Tbl_Customers" field "Job_Type".
> >
> > Example -- When field "Job_Type" = "Warranty" form "Warranty" is opened
> >
> > I have searched through the posts but cannot find a solution.
> >
> > Can someone provide an answer.
> >
> > Thanks
> > Bazmac
>
>
> .
>
|
|
0
|
|
|
|
Reply
|
Utf
|
4/2/2010 2:55:01 AM
|
|
Could it be the typo?
If Me.Job_Type = "Installantion" Then
Installantion <> Installation
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access
"Bazmac" <Bazmac@discussions.microsoft.com> wrote in message
news:8EDA1760-FCE7-4DF5-8973-3C353DB24830@microsoft.com...
> Arvin,
>
> Thankyou for your quick reply I have tried your suggestion the outcome is
> that "Warranty" is the only form to display regardless of job type chosen,
> please find below the original on click procedure follwed by your
> suggestion.
>
> Could you advise were the problem is in the code
>
> Thanking You
> Bazmac
>
> Private Sub Update_Click()
> On Error GoTo Err_Update_Click
>
> Dim stDocName As String
> Dim stLinkCriteria As String
>
> stDocName = "Installation"
>
> stLinkCriteria = "[JobNo]=" & "'" & Me![JobNo] & "'"
> DoCmd.OpenForm stDocName, , , stLinkCriteria
>
>
> Exit_Update_Click:
> Exit Sub
>
> Err_Update_Click:
> MsgBox Err.Description
> Resume Exit_Update_Click
>
>
> End Sub
>
> Private Sub Update_Click()
> On Error GoTo Err_Update_Click
>
> Dim stDocName As String
> Dim stLinkCriteria As String
>
> 'stDocName = "Installation"
>
> 'stLinkCriteria = "[JobNo]=" & "'" & Me![JobNo] & "'"
> 'DoCmd.OpenForm stDocName, , , stLinkCriteria
>
> If Me.Job_Type = "Installantion" Then ' or the Job_TypeID
> DoCmd.OpenForm "Installation", , , "[JobNo]=" & "'" & Me![JobNo] & "'"
> Else
> DoCmd.OpenForm "Warranty", , , "[JobNo]=" & "'" & Me![JobNo] & "'"
> End If
>
>
> Exit_Update_Click:
> Exit Sub
>
> Err_Update_Click:
> MsgBox Err.Description
> Resume Exit_Update_Click
>
>
> End Sub
>
>
> "Arvin Meyer [MVP]" wrote:
>
>> You need to change the recordsource of the form to a query in order to
>> add
>> the Job_Type to the form. Then you need to branch the code with an If ...
>> Then ... Else statement or a Select Case statement. Here's an aircode
>> snippet:
>>
>> If Me.txtJob_Type = "Installantion" Then ' or the Job_TypeID
>> DoCmd.OpenForm "Form1",,, "JobID = " & Me.txtJobID
>> Else
>> DoCmd.OpenForm "Form2",,, "JobID = " & Me.txtJobID
>> End If
>> --
>> Arvin Meyer, MCP, MVP
>> http://www.datastrat.com
>> http://www.accessmvp.com
>> http://www.mvps.org/access
>>
>>
>> "Bazmac" <Bazmac@discussions.microsoft.com> wrote in message
>> news:659ED65A-6434-46E0-9F3F-459985826914@microsoft.com...
>> > Hi
>> >
>> > I have 3 forms "Work_in_progress", "Installations" and Warranty".
>> >
>> > Form "Work_in_progress" is a continuous form that displays uncompleted
>> > work, each line has a control "Update" when pressed it opens form
>> > "Installations" which until recently was fine. We have now secured a
>> > contract
>> > to carryout warranty repairs, which requires a different form to be
>> > completed
>> > ("Warranty").
>> >
>> > The 3 forms has "Tbl_Customers" as their control source which has a
>> > field
>> > "Job_Type" this would contain the following data "Installations or
>> > Warranty".
>> >
>> > What I would like to achieve is that when the control "Update" is
>> > pressed
>> > it
>> > will open either of the forms "Installations" or "Warranty" based on
>> > the
>> > data
>> > in "Tbl_Customers" field "Job_Type".
>> >
>> > Example -- When field "Job_Type" = "Warranty" form "Warranty" is opened
>> >
>> > I have searched through the posts but cannot find a solution.
>> >
>> > Can someone provide an answer.
>> >
>> > Thanks
>> > Bazmac
>>
>>
>> .
>>
|
|
0
|
|
|
|
Reply
|
Arvin
|
4/2/2010 3:58:27 AM
|
|
Alvin,
Thankyou for your help this would have the worked first time if I could
spell properly.(Installantion)
Bazmac
"Bazmac" wrote:
> Arvin,
>
> Thankyou for your quick reply I have tried your suggestion the outcome is
> that "Warranty" is the only form to display regardless of job type chosen,
> please find below the original on click procedure follwed by your suggestion.
>
> Could you advise were the problem is in the code
>
> Thanking You
> Bazmac
>
> Private Sub Update_Click()
> On Error GoTo Err_Update_Click
>
> Dim stDocName As String
> Dim stLinkCriteria As String
>
> stDocName = "Installation"
>
> stLinkCriteria = "[JobNo]=" & "'" & Me![JobNo] & "'"
> DoCmd.OpenForm stDocName, , , stLinkCriteria
>
>
> Exit_Update_Click:
> Exit Sub
>
> Err_Update_Click:
> MsgBox Err.Description
> Resume Exit_Update_Click
>
>
> End Sub
>
> Private Sub Update_Click()
> On Error GoTo Err_Update_Click
>
> Dim stDocName As String
> Dim stLinkCriteria As String
>
> 'stDocName = "Installation"
>
> 'stLinkCriteria = "[JobNo]=" & "'" & Me![JobNo] & "'"
> 'DoCmd.OpenForm stDocName, , , stLinkCriteria
>
> If Me.Job_Type = "Installantion" Then ' or the Job_TypeID
> DoCmd.OpenForm "Installation", , , "[JobNo]=" & "'" & Me![JobNo] & "'"
> Else
> DoCmd.OpenForm "Warranty", , , "[JobNo]=" & "'" & Me![JobNo] & "'"
> End If
>
>
> Exit_Update_Click:
> Exit Sub
>
> Err_Update_Click:
> MsgBox Err.Description
> Resume Exit_Update_Click
>
>
> End Sub
>
>
> "Arvin Meyer [MVP]" wrote:
>
> > You need to change the recordsource of the form to a query in order to add
> > the Job_Type to the form. Then you need to branch the code with an If ...
> > Then ... Else statement or a Select Case statement. Here's an aircode
> > snippet:
> >
> > If Me.txtJob_Type = "Installantion" Then ' or the Job_TypeID
> > DoCmd.OpenForm "Form1",,, "JobID = " & Me.txtJobID
> > Else
> > DoCmd.OpenForm "Form2",,, "JobID = " & Me.txtJobID
> > End If
> > --
> > Arvin Meyer, MCP, MVP
> > http://www.datastrat.com
> > http://www.accessmvp.com
> > http://www.mvps.org/access
> >
> >
> > "Bazmac" <Bazmac@discussions.microsoft.com> wrote in message
> > news:659ED65A-6434-46E0-9F3F-459985826914@microsoft.com...
> > > Hi
> > >
> > > I have 3 forms "Work_in_progress", "Installations" and Warranty".
> > >
> > > Form "Work_in_progress" is a continuous form that displays uncompleted
> > > work, each line has a control "Update" when pressed it opens form
> > > "Installations" which until recently was fine. We have now secured a
> > > contract
> > > to carryout warranty repairs, which requires a different form to be
> > > completed
> > > ("Warranty").
> > >
> > > The 3 forms has "Tbl_Customers" as their control source which has a field
> > > "Job_Type" this would contain the following data "Installations or
> > > Warranty".
> > >
> > > What I would like to achieve is that when the control "Update" is pressed
> > > it
> > > will open either of the forms "Installations" or "Warranty" based on the
> > > data
> > > in "Tbl_Customers" field "Job_Type".
> > >
> > > Example -- When field "Job_Type" = "Warranty" form "Warranty" is opened
> > >
> > > I have searched through the posts but cannot find a solution.
> > >
> > > Can someone provide an answer.
> > >
> > > Thanks
> > > Bazmac
> >
> >
> > .
> >
|
|
0
|
|
|
|
Reply
|
Utf
|
4/2/2010 3:59:01 AM
|
|
|
4 Replies
224 Views
(page loaded in 0.146 seconds)
Similiar Articles: Criteria for opening a form based on a value in another form's ...Hello everyone, Please pardon the noob question, but I've got a form with a subform and I would like to be able to open another form with only the r... Opening one form based on 2 criteria in another form - microsoft ...I have a general form that contains patient information. In this form I can scroll through different exam dates for a particular patient. I need to be able to open a ... Open Report Based on Query - microsoft.public.access.reports ...I have a report based on a Query. In the Query's criteria On one field I have this =Forms!frmCheckAction!TxtSalesID How do I open this report based ... Multiple-criteria search on form, to open form - microsoft.public ...Open new form based on two criteria - microsoft.public.access ... Multiple-criteria search on form, to open form - microsoft.public ..... if no matching records create a ... Column Hiding based on Selected Criteria - microsoft.public.access ...Open new form based on two criteria - microsoft.public.access ... Middle mouse button does not always open in new tab anymore ... Open the form with ... Run Macro only if certain form is open - microsoft.public.access ...I have programed a maco to open one of various forms depending on criteria on an open form. Is there a way to run a "follow up Macro" based on which... Opening Forms based on Combo Box Selection (Access 2007 ...Opening one form based on 2 criteria in another form - microsoft ... Opening Forms based on Combo Box Selection (Access 2007 ... Open Form Based On Query Selection ... If then statement in Visual Basic - microsoft.public.access ...I have created 2 buttons to open 2 different forms but I would like to create one button to open a certain form based on certain criteria. Here is my... Open Form based on Current record without unique ID/Key ...All, I was wondering if there was a way to open a form based only on the current record ... I realized that I do have a unique field that I can use as a link criteria. Generating a list dependent on specific criteria - microsoft ...If then statement in Visual Basic - microsoft.public.access ..... forms but I would like to create one button to open a certain form based on certain criteria. ... MS ACCESS :: Opening Forms Based On CriteriaOpening A Subform Based On Criteria From A Combo Box The posting in archive t-31918 was very helpful and almost does the trick. I have a subform with gifttype that ... Question Please Help! Open a form based on criteria - Access World ...Microsoft Access Discussion > General ... I need to open a form based on a record name and the type of form is based on a ... Why not just add VBA code to the ... Microsoft Access: Open and filter form results based on 2-criteria ...database.itags.org: Microsoft Access question: Open and filter form results based on 2-criteria, created at:Fri, 04 Jan 2008 16:28:00 GMT with 768 bytes, last updated ... Criteria for opening a form based on a value in another form's ...Hello everyone, Please pardon the noob question, but I've got a form with a subform and I would like to be able to open another form with only the r... Opening one form based on 2 criteria in another form - microsoft ...I have a general form that contains patient information. In this form I can scroll through different exam dates for a particular patient. I need to be able to open a ... 7/29/2012 11:01:13 PM
|