Results 1 to 7 of 7
  1. #1
    Star Lounger
    Join Date
    Sep 2002
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Date type conversion error (Access 2000)

    In my code for remote control i wanted to remove the properties Required and Indexed of a field, but i receive the date type conversion error.How can i change these properties by code ?
    Below is a part of my code
    Set tdf = dbs.TableDefs("customers")
    Set fld = tdf.Fields("afid")
    fld.Properties("Required") = ""
    flr.Properties("indexed) = ""
    dbs.Close
    Set fld = Nothing
    Set tdf = Nothing
    Set dbs = Nothing
    Set wsp = Nothing

    etc

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Date type conversion error (Access 2000)

    To set a field to not requred, simply use

    fld.Required = False

    It is also possible to use

    fld.Properties("Required") = False

    Note that Required is a boolean (True/False) property, not a string, so you cannot set it to "".

    As far as I know, there is no Indexed property of a field.

  3. #3
    Star Lounger
    Join Date
    Sep 2002
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date type conversion error (Access 2000)

    Thank you. You write that here is no indexed property of a field.At the end of the list of the properties of the field,just below Required, it is written Indexed.Yes (Duplicates OK). i want to turn it to No and i write False, but it says property is unkown. What is the exact property and the command to turn it to No ?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Date type conversion error (Access 2000)

    The Access interface is not the same as the DAO object model. You'll have to loop through the Indexes collection of the TableDef, and loop through the Fields collection of each index to see if the field is among them. If so, delete the index. But of course, it is much easier to delete the index in the Access interface.

  5. #5
    Star Lounger
    Join Date
    Sep 2002
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date type conversion error (Access 2000)

    Thank you. is it possible to help me writing out the code for that? I will be much indebted.I have no access to the Access interface and i will have to send the code.

    greetings

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Date type conversion error (Access 2000)

    We can help you with details, but we're not going to do your homework for you. Search this forum for keywords such as tabledefs indexes. You'll find several examples of looping through the indexes of a table.

  7. #7
    Star Lounger
    Join Date
    Sep 2002
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date type conversion error (Access 2000)

    thank you anyway

Posting Permissions

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