Results 1 to 5 of 5

Thread: Simple assignment help, please.

  1. #1
    Guest

    Thumbs up

    Ok, I give. I'm stupid. I'm dumber than squirels. I do
    what voices tell me to.

    What's wrong with this statement:

    RCS_dflt.Fields(0).Value = Information


    (RCS_Dflt IS an updateable recordset, The field IS string,
    Information IS string)

    DerFarm

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Try using the field's name:
    Code:
    RCS_dflt!FieldName = Information
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3
    Guest
    Thanks, Parksie, but it didn't work. I must be asking the
    wrong question, or I didn't include all the necessary
    information.

    [/code]
    Check_for_Default_Value:
    Set RCS_dflt = DB_Dflt.OpenRecordset(TBL_Name)
    If RCS_Dflt.EOF = True Or RCS_dflt.BOF = True Then
    RCS_Dflt.AddNew
    RCS_Dflt.Update
    GoTo Check_for_Default_Value
    Else
    RCS_Dflt.MoveFirst
    RCS_Dflt!DefaultValue = Information
    End If
    [/code]

    What the above is SUPPOSED to do is check to see if RCS_Dflt
    has any records, add a blank if none, then repeat the
    process changing DefaultValue to Information.

    The first part is happening. I can go into the database
    and there is a table TBL_Name, with one blank record. When
    it hits
    [/code]
    RCS_Dflt!DefaultValue = Information
    [/code]
    however, it jumps to the exit marker (I have an On error....)


    Does this make more sense?

    DerFarm

  4. #4
    Guest
    RobIII --

    Yes, Virginia, there IS a goto.....for now. I will replace
    it with a different construct after the it is working
    properly. Goto's are allowable, but ONLY as a method of
    leaving the module.

    One entry:One Exit


    DerFarm

  5. #5
    Guest

    Thumbs up

    Here is the code....sans goto...and working. Thank you BruceG.

    [/code]
    If RCS_Dflt.EOF = True Or RCS_Dflt.BOF = True Then
    RCS_Dflt.AddNew
    RCS_Dflt.Update
    End If

    RCS_Dflt.MoveFirst
    RCS_Dflt.Edit
    RCS_Dflt!DefaultValue.Value = Information
    RCS_Dflt.Update

    [/code]

    DerFarm

Posting Permissions

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



Click Here to Expand Forum to Full Width