PC Review


Reply
Thread Tools Rate Thread

Method or Data Member not found?

 
 
=?Utf-8?B?U2hhcm9u?=
Guest
Posts: n/a
 
      1st Aug 2005
When I run the code below it gives me the error that Method or Data Member
not found. I have compared the "frmExpenseReport" and they appear to be the
same as the "frmPurchaseOrder" as far as properties, etc. I added the
stDocName = "frmPurchaseOrder" because when the drop down opens the name
PurchaseOrderID doesn't show, but the PurchaseOrderID_Label does? Why?
How do I fix this? What I am trying to do is that when the button is
clicked, depending on the value selected in another combo box, I want it to
open either one form (frmExpenseReport) or another (frmPurchaseOrder).
Thanks for any help.

Private Sub VIEW_REPORT_Click()
On Error GoTo Err_VIEW_EXPENSE_REPORT_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmExpenseReport"
stDocName = "frmPurchaseOrder"

If Me!cmbMethodofPayment = 1 Then
DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = " &
Me.ExpenseReportID

ElseIf Me!cmbMethodofPayment = 2 Then
DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = " &
Me.ExpenseReportID

ElseIf Me!cmbMethodofPayment = 3 Then
DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = " &
Me.ExpenseReportID

ElseIf Me!cmbMethodofPayment = 4 Then
DoCmd.OpenForm "frmPurchaseOrder", , , "PurchaseOrderID = " &
Me.PurchaseOrderID

End If



-
S
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Q2hhaW0=?=
Guest
Posts: n/a
 
      1st Aug 2005
Sharon,

Since you set stDocName in two consecutive statements, the value is just the
last value assigned. Where is stDocName being used? It shows up no place in
this piece of code. This is clearly not the entire event procedure.

Have you run this with the debugger so that you know which Method or Data
Member it is specifically complaining about?

Maybe you should post all of the procedure and tell us what method or data
member it is complaining about. Also, how do you have your combo box
(cmbMethodofPayment) set up? How many columns? Which is the bound column?
What does its data source look like?

Good Luck!
--
Chaim


"Sharon" wrote:

> When I run the code below it gives me the error that Method or Data Member
> not found. I have compared the "frmExpenseReport" and they appear to be the
> same as the "frmPurchaseOrder" as far as properties, etc. I added the
> stDocName = "frmPurchaseOrder" because when the drop down opens the name
> PurchaseOrderID doesn't show, but the PurchaseOrderID_Label does? Why?
> How do I fix this? What I am trying to do is that when the button is
> clicked, depending on the value selected in another combo box, I want it to
> open either one form (frmExpenseReport) or another (frmPurchaseOrder).
> Thanks for any help.
>
> Private Sub VIEW_REPORT_Click()
> On Error GoTo Err_VIEW_EXPENSE_REPORT_Click
>
> Dim stDocName As String
> Dim stLinkCriteria As String
>
> stDocName = "frmExpenseReport"
> stDocName = "frmPurchaseOrder"
>
> If Me!cmbMethodofPayment = 1 Then
> DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = " &
> Me.ExpenseReportID
>
> ElseIf Me!cmbMethodofPayment = 2 Then
> DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = " &
> Me.ExpenseReportID
>
> ElseIf Me!cmbMethodofPayment = 3 Then
> DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = " &
> Me.ExpenseReportID
>
> ElseIf Me!cmbMethodofPayment = 4 Then
> DoCmd.OpenForm "frmPurchaseOrder", , , "PurchaseOrderID = " &
> Me.PurchaseOrderID
>
> End If
>
>
>
> -
> S

 
Reply With Quote
 
 
 
 
=?Utf-8?B?Snd5?=
Guest
Posts: n/a
 
      20th Oct 2005
I am experiencing the same problem. I have a table field named RecordID
which is not used on a form. When I try to use code:

If Me.ProjectStatus = "Completed" Then
Me.RecordID = "PZ"
End If

I get the error message "Method or Data Member not found" for RecordID.

I can't see the field RecordID in the drop down box when entering the code,
yet it is in the table.

Why is this happening?

All help is appreciated.



"Chaim" wrote:

> Sharon,
>
> Since you set stDocName in two consecutive statements, the value is just the
> last value assigned. Where is stDocName being used? It shows up no place in
> this piece of code. This is clearly not the entire event procedure.
>
> Have you run this with the debugger so that you know which Method or Data
> Member it is specifically complaining about?
>
> Maybe you should post all of the procedure and tell us what method or data
> member it is complaining about. Also, how do you have your combo box
> (cmbMethodofPayment) set up? How many columns? Which is the bound column?
> What does its data source look like?
>
> Good Luck!
> --
> Chaim
>
>
> "Sharon" wrote:
>
> > When I run the code below it gives me the error that Method or Data Member
> > not found. I have compared the "frmExpenseReport" and they appear to be the
> > same as the "frmPurchaseOrder" as far as properties, etc. I added the
> > stDocName = "frmPurchaseOrder" because when the drop down opens the name
> > PurchaseOrderID doesn't show, but the PurchaseOrderID_Label does? Why?
> > How do I fix this? What I am trying to do is that when the button is
> > clicked, depending on the value selected in another combo box, I want it to
> > open either one form (frmExpenseReport) or another (frmPurchaseOrder).
> > Thanks for any help.
> >
> > Private Sub VIEW_REPORT_Click()
> > On Error GoTo Err_VIEW_EXPENSE_REPORT_Click
> >
> > Dim stDocName As String
> > Dim stLinkCriteria As String
> >
> > stDocName = "frmExpenseReport"
> > stDocName = "frmPurchaseOrder"
> >
> > If Me!cmbMethodofPayment = 1 Then
> > DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = " &
> > Me.ExpenseReportID
> >
> > ElseIf Me!cmbMethodofPayment = 2 Then
> > DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = " &
> > Me.ExpenseReportID
> >
> > ElseIf Me!cmbMethodofPayment = 3 Then
> > DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = " &
> > Me.ExpenseReportID
> >
> > ElseIf Me!cmbMethodofPayment = 4 Then
> > DoCmd.OpenForm "frmPurchaseOrder", , , "PurchaseOrderID = " &
> > Me.PurchaseOrderID
> >
> > End If
> >
> >
> >
> > -
> > S

 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      20th Oct 2005
Is your form perhaps based on a query that doesn't include that field?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Jwy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I am experiencing the same problem. I have a table field named RecordID
> which is not used on a form. When I try to use code:
>
> If Me.ProjectStatus = "Completed" Then
> Me.RecordID = "PZ"
> End If
>
> I get the error message "Method or Data Member not found" for RecordID.
>
> I can't see the field RecordID in the drop down box when entering the
> code,
> yet it is in the table.
>
> Why is this happening?
>
> All help is appreciated.
>
>
>
> "Chaim" wrote:
>
>> Sharon,
>>
>> Since you set stDocName in two consecutive statements, the value is just
>> the
>> last value assigned. Where is stDocName being used? It shows up no place
>> in
>> this piece of code. This is clearly not the entire event procedure.
>>
>> Have you run this with the debugger so that you know which Method or Data
>> Member it is specifically complaining about?
>>
>> Maybe you should post all of the procedure and tell us what method or
>> data
>> member it is complaining about. Also, how do you have your combo box
>> (cmbMethodofPayment) set up? How many columns? Which is the bound column?
>> What does its data source look like?
>>
>> Good Luck!
>> --
>> Chaim
>>
>>
>> "Sharon" wrote:
>>
>> > When I run the code below it gives me the error that Method or Data
>> > Member
>> > not found. I have compared the "frmExpenseReport" and they appear to
>> > be the
>> > same as the "frmPurchaseOrder" as far as properties, etc. I added the
>> > stDocName = "frmPurchaseOrder" because when the drop down opens the
>> > name
>> > PurchaseOrderID doesn't show, but the PurchaseOrderID_Label does? Why?
>> > How do I fix this? What I am trying to do is that when the button is
>> > clicked, depending on the value selected in another combo box, I want
>> > it to
>> > open either one form (frmExpenseReport) or another (frmPurchaseOrder).
>> > Thanks for any help.
>> >
>> > Private Sub VIEW_REPORT_Click()
>> > On Error GoTo Err_VIEW_EXPENSE_REPORT_Click
>> >
>> > Dim stDocName As String
>> > Dim stLinkCriteria As String
>> >
>> > stDocName = "frmExpenseReport"
>> > stDocName = "frmPurchaseOrder"
>> >
>> > If Me!cmbMethodofPayment = 1 Then
>> > DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = " &
>> > Me.ExpenseReportID
>> >
>> > ElseIf Me!cmbMethodofPayment = 2 Then
>> > DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = " &
>> > Me.ExpenseReportID
>> >
>> > ElseIf Me!cmbMethodofPayment = 3 Then
>> > DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = " &
>> > Me.ExpenseReportID
>> >
>> > ElseIf Me!cmbMethodofPayment = 4 Then
>> > DoCmd.OpenForm "frmPurchaseOrder", , , "PurchaseOrderID = " &
>> > Me.PurchaseOrderID
>> >
>> > End If
>> >
>> >
>> >
>> > -
>> > S



 
Reply With Quote
 
=?Utf-8?B?Snd5?=
Guest
Posts: n/a
 
      20th Oct 2005
No, my Query does include the field.

"Douglas J. Steele" wrote:

> Is your form perhaps based on a query that doesn't include that field?
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
>
>
>
> "Jwy" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >I am experiencing the same problem. I have a table field named RecordID
> > which is not used on a form. When I try to use code:
> >
> > If Me.ProjectStatus = "Completed" Then
> > Me.RecordID = "PZ"
> > End If
> >
> > I get the error message "Method or Data Member not found" for RecordID.
> >
> > I can't see the field RecordID in the drop down box when entering the
> > code,
> > yet it is in the table.
> >
> > Why is this happening?
> >
> > All help is appreciated.
> >
> >
> >
> > "Chaim" wrote:
> >
> >> Sharon,
> >>
> >> Since you set stDocName in two consecutive statements, the value is just
> >> the
> >> last value assigned. Where is stDocName being used? It shows up no place
> >> in
> >> this piece of code. This is clearly not the entire event procedure.
> >>
> >> Have you run this with the debugger so that you know which Method or Data
> >> Member it is specifically complaining about?
> >>
> >> Maybe you should post all of the procedure and tell us what method or
> >> data
> >> member it is complaining about. Also, how do you have your combo box
> >> (cmbMethodofPayment) set up? How many columns? Which is the bound column?
> >> What does its data source look like?
> >>
> >> Good Luck!
> >> --
> >> Chaim
> >>
> >>
> >> "Sharon" wrote:
> >>
> >> > When I run the code below it gives me the error that Method or Data
> >> > Member
> >> > not found. I have compared the "frmExpenseReport" and they appear to
> >> > be the
> >> > same as the "frmPurchaseOrder" as far as properties, etc. I added the
> >> > stDocName = "frmPurchaseOrder" because when the drop down opens the
> >> > name
> >> > PurchaseOrderID doesn't show, but the PurchaseOrderID_Label does? Why?
> >> > How do I fix this? What I am trying to do is that when the button is
> >> > clicked, depending on the value selected in another combo box, I want
> >> > it to
> >> > open either one form (frmExpenseReport) or another (frmPurchaseOrder).
> >> > Thanks for any help.
> >> >
> >> > Private Sub VIEW_REPORT_Click()
> >> > On Error GoTo Err_VIEW_EXPENSE_REPORT_Click
> >> >
> >> > Dim stDocName As String
> >> > Dim stLinkCriteria As String
> >> >
> >> > stDocName = "frmExpenseReport"
> >> > stDocName = "frmPurchaseOrder"
> >> >
> >> > If Me!cmbMethodofPayment = 1 Then
> >> > DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = " &
> >> > Me.ExpenseReportID
> >> >
> >> > ElseIf Me!cmbMethodofPayment = 2 Then
> >> > DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = " &
> >> > Me.ExpenseReportID
> >> >
> >> > ElseIf Me!cmbMethodofPayment = 3 Then
> >> > DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = " &
> >> > Me.ExpenseReportID
> >> >
> >> > ElseIf Me!cmbMethodofPayment = 4 Then
> >> > DoCmd.OpenForm "frmPurchaseOrder", , , "PurchaseOrderID = " &
> >> > Me.PurchaseOrderID
> >> >
> >> > End If
> >> >
> >> >
> >> >
> >> > -
> >> > S

>
>
>

 
Reply With Quote
 
Brendan Reynolds
Guest
Posts: n/a
 
      21st Oct 2005
Is the field included in the SELECT clause? A field could be included in a
WHERE clause, or an ORDER BY clause, without being included in the SELECT
clause, in which case it would not be available as a property of the form.
In the first two examples below, the field 'RecordID' will not be available,
only the third example will make this field available as a property of the
form ...

SELECT FieldOne, FieldTwo FROM SomeTable WHERE RecordID = Whatever

SELECT FieldOne, FieldTwo FROM SomeTable ORDER BY RecordID

SELECT FieldONe, FieldTwo, RecordID FROM SomeTable

Another possibility is that the field might be aliased ...

SELECT Format([RecordID], "00000") AS Whatever FROM SomeTable

In this example, you could not refer to the field as 'RecordID'. You could
read it using the alias ('Whatever' in the example above) but to write to it
you'd need to add an additional reference to the actual field to the query
....

SELECT RecordID, Format([RecordID], "00000") AS Whatever FROM SomeTable

If this doesn't enable you to resolve the problem, try posting the SQL for
the query, I'm sure someone will be able to see what the problem is.

--
Brendan Reynolds


"Jwy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> No, my Query does include the field.
>
> "Douglas J. Steele" wrote:
>
>> Is your form perhaps based on a query that doesn't include that field?
>>
>> --
>> Doug Steele, Microsoft Access MVP
>> http://I.Am/DougSteele
>> (no e-mails, please!)
>>
>>
>>
>> "Jwy" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> >I am experiencing the same problem. I have a table field named RecordID
>> > which is not used on a form. When I try to use code:
>> >
>> > If Me.ProjectStatus = "Completed" Then
>> > Me.RecordID = "PZ"
>> > End If
>> >
>> > I get the error message "Method or Data Member not found" for RecordID.
>> >
>> > I can't see the field RecordID in the drop down box when entering the
>> > code,
>> > yet it is in the table.
>> >
>> > Why is this happening?
>> >
>> > All help is appreciated.
>> >
>> >
>> >
>> > "Chaim" wrote:
>> >
>> >> Sharon,
>> >>
>> >> Since you set stDocName in two consecutive statements, the value is
>> >> just
>> >> the
>> >> last value assigned. Where is stDocName being used? It shows up no
>> >> place
>> >> in
>> >> this piece of code. This is clearly not the entire event procedure.
>> >>
>> >> Have you run this with the debugger so that you know which Method or
>> >> Data
>> >> Member it is specifically complaining about?
>> >>
>> >> Maybe you should post all of the procedure and tell us what method or
>> >> data
>> >> member it is complaining about. Also, how do you have your combo box
>> >> (cmbMethodofPayment) set up? How many columns? Which is the bound
>> >> column?
>> >> What does its data source look like?
>> >>
>> >> Good Luck!
>> >> --
>> >> Chaim
>> >>
>> >>
>> >> "Sharon" wrote:
>> >>
>> >> > When I run the code below it gives me the error that Method or Data
>> >> > Member
>> >> > not found. I have compared the "frmExpenseReport" and they appear
>> >> > to
>> >> > be the
>> >> > same as the "frmPurchaseOrder" as far as properties, etc. I added
>> >> > the
>> >> > stDocName = "frmPurchaseOrder" because when the drop down opens the
>> >> > name
>> >> > PurchaseOrderID doesn't show, but the PurchaseOrderID_Label does?
>> >> > Why?
>> >> > How do I fix this? What I am trying to do is that when the button
>> >> > is
>> >> > clicked, depending on the value selected in another combo box, I
>> >> > want
>> >> > it to
>> >> > open either one form (frmExpenseReport) or another
>> >> > (frmPurchaseOrder).
>> >> > Thanks for any help.
>> >> >
>> >> > Private Sub VIEW_REPORT_Click()
>> >> > On Error GoTo Err_VIEW_EXPENSE_REPORT_Click
>> >> >
>> >> > Dim stDocName As String
>> >> > Dim stLinkCriteria As String
>> >> >
>> >> > stDocName = "frmExpenseReport"
>> >> > stDocName = "frmPurchaseOrder"
>> >> >
>> >> > If Me!cmbMethodofPayment = 1 Then
>> >> > DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = " &
>> >> > Me.ExpenseReportID
>> >> >
>> >> > ElseIf Me!cmbMethodofPayment = 2 Then
>> >> > DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = "
>> >> > &
>> >> > Me.ExpenseReportID
>> >> >
>> >> > ElseIf Me!cmbMethodofPayment = 3 Then
>> >> > DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = "
>> >> > &
>> >> > Me.ExpenseReportID
>> >> >
>> >> > ElseIf Me!cmbMethodofPayment = 4 Then
>> >> > DoCmd.OpenForm "frmPurchaseOrder", , , "PurchaseOrderID = "
>> >> > &
>> >> > Me.PurchaseOrderID
>> >> >
>> >> > End If
>> >> >
>> >> >
>> >> >
>> >> > -
>> >> > S

>>
>>
>>



 
Reply With Quote
 
MacDermott
Guest
Posts: n/a
 
      21st Oct 2005
In some such situations, I've resorted to creating a textbox for RecordID,
and setting its visible property to False.

"Jwy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> No, my Query does include the field.
>
> "Douglas J. Steele" wrote:
>
> > Is your form perhaps based on a query that doesn't include that field?
> >
> > --
> > Doug Steele, Microsoft Access MVP
> > http://I.Am/DougSteele
> > (no e-mails, please!)
> >
> >
> >
> > "Jwy" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > >I am experiencing the same problem. I have a table field named

RecordID
> > > which is not used on a form. When I try to use code:
> > >
> > > If Me.ProjectStatus = "Completed" Then
> > > Me.RecordID = "PZ"
> > > End If
> > >
> > > I get the error message "Method or Data Member not found" for

RecordID.
> > >
> > > I can't see the field RecordID in the drop down box when entering the
> > > code,
> > > yet it is in the table.
> > >
> > > Why is this happening?
> > >
> > > All help is appreciated.
> > >
> > >
> > >
> > > "Chaim" wrote:
> > >
> > >> Sharon,
> > >>
> > >> Since you set stDocName in two consecutive statements, the value is

just
> > >> the
> > >> last value assigned. Where is stDocName being used? It shows up no

place
> > >> in
> > >> this piece of code. This is clearly not the entire event procedure.
> > >>
> > >> Have you run this with the debugger so that you know which Method or

Data
> > >> Member it is specifically complaining about?
> > >>
> > >> Maybe you should post all of the procedure and tell us what method or
> > >> data
> > >> member it is complaining about. Also, how do you have your combo box
> > >> (cmbMethodofPayment) set up? How many columns? Which is the bound

column?
> > >> What does its data source look like?
> > >>
> > >> Good Luck!
> > >> --
> > >> Chaim
> > >>
> > >>
> > >> "Sharon" wrote:
> > >>
> > >> > When I run the code below it gives me the error that Method or Data
> > >> > Member
> > >> > not found. I have compared the "frmExpenseReport" and they appear

to
> > >> > be the
> > >> > same as the "frmPurchaseOrder" as far as properties, etc. I added

the
> > >> > stDocName = "frmPurchaseOrder" because when the drop down opens the
> > >> > name
> > >> > PurchaseOrderID doesn't show, but the PurchaseOrderID_Label does?

Why?
> > >> > How do I fix this? What I am trying to do is that when the button

is
> > >> > clicked, depending on the value selected in another combo box, I

want
> > >> > it to
> > >> > open either one form (frmExpenseReport) or another

(frmPurchaseOrder).
> > >> > Thanks for any help.
> > >> >
> > >> > Private Sub VIEW_REPORT_Click()
> > >> > On Error GoTo Err_VIEW_EXPENSE_REPORT_Click
> > >> >
> > >> > Dim stDocName As String
> > >> > Dim stLinkCriteria As String
> > >> >
> > >> > stDocName = "frmExpenseReport"
> > >> > stDocName = "frmPurchaseOrder"
> > >> >
> > >> > If Me!cmbMethodofPayment = 1 Then
> > >> > DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = "

&
> > >> > Me.ExpenseReportID
> > >> >
> > >> > ElseIf Me!cmbMethodofPayment = 2 Then
> > >> > DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = "

&
> > >> > Me.ExpenseReportID
> > >> >
> > >> > ElseIf Me!cmbMethodofPayment = 3 Then
> > >> > DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = "

&
> > >> > Me.ExpenseReportID
> > >> >
> > >> > ElseIf Me!cmbMethodofPayment = 4 Then
> > >> > DoCmd.OpenForm "frmPurchaseOrder", , , "PurchaseOrderID = "

&
> > >> > Me.PurchaseOrderID
> > >> >
> > >> > End If
> > >> >
> > >> >
> > >> >
> > >> > -
> > >> > S

> >
> >
> >



 
Reply With Quote
 
=?Utf-8?B?Snd5?=
Guest
Posts: n/a
 
      21st Oct 2005
Thanks, this idea worked. Strange, though, I had another field in the table
that I was using to test with and I had no problem what so ever. This test
field was not even in the query and it updated just fine.

Thanks for your help!

"MacDermott" wrote:

> In some such situations, I've resorted to creating a textbox for RecordID,
> and setting its visible property to False.
>
> "Jwy" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > No, my Query does include the field.
> >
> > "Douglas J. Steele" wrote:
> >
> > > Is your form perhaps based on a query that doesn't include that field?
> > >
> > > --
> > > Doug Steele, Microsoft Access MVP
> > > http://I.Am/DougSteele
> > > (no e-mails, please!)
> > >
> > >
> > >
> > > "Jwy" <(E-Mail Removed)> wrote in message
> > > news:(E-Mail Removed)...
> > > >I am experiencing the same problem. I have a table field named

> RecordID
> > > > which is not used on a form. When I try to use code:
> > > >
> > > > If Me.ProjectStatus = "Completed" Then
> > > > Me.RecordID = "PZ"
> > > > End If
> > > >
> > > > I get the error message "Method or Data Member not found" for

> RecordID.
> > > >
> > > > I can't see the field RecordID in the drop down box when entering the
> > > > code,
> > > > yet it is in the table.
> > > >
> > > > Why is this happening?
> > > >
> > > > All help is appreciated.
> > > >
> > > >
> > > >
> > > > "Chaim" wrote:
> > > >
> > > >> Sharon,
> > > >>
> > > >> Since you set stDocName in two consecutive statements, the value is

> just
> > > >> the
> > > >> last value assigned. Where is stDocName being used? It shows up no

> place
> > > >> in
> > > >> this piece of code. This is clearly not the entire event procedure.
> > > >>
> > > >> Have you run this with the debugger so that you know which Method or

> Data
> > > >> Member it is specifically complaining about?
> > > >>
> > > >> Maybe you should post all of the procedure and tell us what method or
> > > >> data
> > > >> member it is complaining about. Also, how do you have your combo box
> > > >> (cmbMethodofPayment) set up? How many columns? Which is the bound

> column?
> > > >> What does its data source look like?
> > > >>
> > > >> Good Luck!
> > > >> --
> > > >> Chaim
> > > >>
> > > >>
> > > >> "Sharon" wrote:
> > > >>
> > > >> > When I run the code below it gives me the error that Method or Data
> > > >> > Member
> > > >> > not found. I have compared the "frmExpenseReport" and they appear

> to
> > > >> > be the
> > > >> > same as the "frmPurchaseOrder" as far as properties, etc. I added

> the
> > > >> > stDocName = "frmPurchaseOrder" because when the drop down opens the
> > > >> > name
> > > >> > PurchaseOrderID doesn't show, but the PurchaseOrderID_Label does?

> Why?
> > > >> > How do I fix this? What I am trying to do is that when the button

> is
> > > >> > clicked, depending on the value selected in another combo box, I

> want
> > > >> > it to
> > > >> > open either one form (frmExpenseReport) or another

> (frmPurchaseOrder).
> > > >> > Thanks for any help.
> > > >> >
> > > >> > Private Sub VIEW_REPORT_Click()
> > > >> > On Error GoTo Err_VIEW_EXPENSE_REPORT_Click
> > > >> >
> > > >> > Dim stDocName As String
> > > >> > Dim stLinkCriteria As String
> > > >> >
> > > >> > stDocName = "frmExpenseReport"
> > > >> > stDocName = "frmPurchaseOrder"
> > > >> >
> > > >> > If Me!cmbMethodofPayment = 1 Then
> > > >> > DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = "

> &
> > > >> > Me.ExpenseReportID
> > > >> >
> > > >> > ElseIf Me!cmbMethodofPayment = 2 Then
> > > >> > DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = "

> &
> > > >> > Me.ExpenseReportID
> > > >> >
> > > >> > ElseIf Me!cmbMethodofPayment = 3 Then
> > > >> > DoCmd.OpenForm "frmExpenseReport", , , "ExpenseReportID = "

> &
> > > >> > Me.ExpenseReportID
> > > >> >
> > > >> > ElseIf Me!cmbMethodofPayment = 4 Then
> > > >> > DoCmd.OpenForm "frmPurchaseOrder", , , "PurchaseOrderID = "

> &
> > > >> > Me.PurchaseOrderID
> > > >> >
> > > >> > End If
> > > >> >
> > > >> >
> > > >> >
> > > >> > -
> > > >> > S
> > >
> > >
> > >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access of shared member, constant member, enum member or nested type through an instance Jeffrey Grantz Microsoft VB .NET 3 7th Sep 2006 04:09 PM
Method or data member not found with Move method Kate Microsoft Access Form Coding 2 1st Dec 2004 03:58 PM
pointer to member conversion to a pointer to member that is a member's base class Vladimir_petter Microsoft VC .NET 12 19th Aug 2004 06:20 PM
Cannot refer to an instance member of a class from within a shared method or shared member initializer without an explicit instance of the class. DJ Dev Microsoft ASP .NET 3 8th Feb 2004 05:19 PM
struct member initialization - member by member?! emma middlebrook Microsoft C# .NET 10 28th Jul 2003 08:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:50 AM.