Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003
    Posts
    28

    Unanswered: DAO Question - May seem VERY simple...

    ok, can I, using DAO (or ADO if I should) modify a field specified in another field?

    I am new to object oriented database programming, as you can probably see by the questions I ask. Here is yet another.

    I can change data in a field by : Rst!FieldName = NewData
    can I change it like:

    FN = 'FieldName'
    Rst!Fields(FN)!Value = NewData

    ??????? :\

    I NEED to be able to specify what field is to be changed within another field OR variable. If you know ANY way to do this using objects Please Help, and Thank you

  2. #2
    Join Date
    Dec 2003
    Posts
    28

    Hi SBaxter and BasicMek

    I am trying :

    Set LinkerRst = Db.OpenRecordset("SELECT " & PTypeRst!PV_1_Field & " From Linker WHERE Inv_Number = '" & InvNum & "'")

    So it only pulls one field. Then maybe I can modify it by specifying it's ordinal of 0, and it will always be the right field, right???

  3. #3
    Join Date
    Jan 2004
    Posts
    184

    Re: DAO Question - May seem VERY simple...

    Yes that should work but use double quotations instead of single quotations:

    i.e.:
    FN = "FieldName"
    Rst.Fields(FN).Value = NewData

    You can also use the field number

    FN = 2
    Rst.Fields(FN).Value = NewData

    Also try this control featured on download.com that I have been using that has made my life easier:

    http://www.geocities.com/scirocco_ha/DataControl.htm

    I bind my controls and that is it All the complexities of ADO are hidden from the user which is you.

    Then I can Navigate, Add New, Delete, Refresh, Search and Save Changes to my recordsets without any other code. That is really it, no other code is needed.

    This works in any environment VB, Access, VC++ etc...

    Let me know what you think.

    Originally posted by PainGypsy
    ok, can I, using DAO (or ADO if I should) modify a field specified in another field?

    I am new to object oriented database programming, as you can probably see by the questions I ask. Here is yet another.

    I can change data in a field by : Rst!FieldName = NewData
    can I change it like:

    FN = 'FieldName'
    Rst!Fields(FN)!Value = NewData

    ??????? :\

    I NEED to be able to specify what field is to be changed within another field OR variable. If you know ANY way to do this using objects Please Help, and Thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •