Method or Data Member not found?

Discussion in 'Microsoft Access Form Coding' started by Guest, Aug 1, 2005.

  1. Guest

    Guest Guest

    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
     
    Guest, Aug 1, 2005
    #1
    1. Advertisements

  2. Guest

    Guest Guest

    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
     
    Guest, Aug 1, 2005
    #2
    1. Advertisements

  3. Guest

    Guest Guest

    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
     
    Guest, Oct 20, 2005
    #3
  4. 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" <> wrote in message
    news:...
    >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
     
    Douglas J. Steele, Oct 20, 2005
    #4
  5. Guest

    Guest Guest

    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" <> wrote in message
    > news:...
    > >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

    >
    >
    >
     
    Guest, Oct 20, 2005
    #5
  6. 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" <> wrote in message
    news:...
    > 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" <> wrote in message
    >> news:...
    >> >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

    >>
    >>
    >>
     
    Brendan Reynolds, Oct 21, 2005
    #6
  7. Guest

    MacDermott Guest

    In some such situations, I've resorted to creating a textbox for RecordID,
    and setting its visible property to False.

    "Jwy" <> wrote in message
    news:...
    > 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" <> wrote in message
    > > news:...
    > > >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

    > >
    > >
    > >
     
    MacDermott, Oct 21, 2005
    #7
  8. Guest

    Guest Guest

    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" <> wrote in message
    > news:...
    > > 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" <> wrote in message
    > > > news:...
    > > > >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
    > > >
    > > >
    > > >

    >
    >
    >
     
    Guest, Oct 21, 2005
    #8
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. RB

    Method or data member not found

    RB, Jul 3, 2003, in forum: Microsoft Access Form Coding
    Replies:
    1
    Views:
    623
  2. Erik Gjertsen

    Method or data member not found (Error 461)

    Erik Gjertsen, Oct 4, 2003, in forum: Microsoft Access Form Coding
    Replies:
    2
    Views:
    717
    Van T. Dinh
    Oct 5, 2003
  3. Angelo

    incorrect METHOD OR DATA MEMBER NOT FOUND compile error

    Angelo, Oct 6, 2003, in forum: Microsoft Access Form Coding
    Replies:
    3
    Views:
    310
    Cheryl Fischer
    Oct 7, 2003
  4. Kate

    Method or data member not found with Move method

    Kate, Nov 30, 2004, in forum: Microsoft Access Form Coding
    Replies:
    2
    Views:
    520
  5. Guest

    Member or Data Member not Found

    Guest, Apr 27, 2006, in forum: Microsoft Access Form Coding
    Replies:
    11
    Views:
    390
    Douglas J. Steele
    Apr 28, 2006
Loading...

Share This Page