Results 1 to 9 of 9
  1. #1
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368

    Unusable field name

    Hey guys,



    Im importing a .CSV file using the import wizard.
    The data im pulling from the file works great. However i want to display the date
    the data is from (Not per se the date the file was created).

    The date is in the csv file, however the import wizard creates its own field name.
    The field holds the date, but the fieldname is......."Tijdstip";"Details";"Gebeurtenistype";"B ron"
    Im not kidding haha
    Its Dutch for "Time";"Details";"Eventtype";"Source"

    Now, i tried to put that fieldname in brackets in my dlookup but access wont do that.

    Any suggestion ?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Which field?

    The brackets should force the name to be accepted.

    What does 'wont do that' mean - error message, wrong results, nothing happens?

    Post the DLookup expression.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368
    Hey June, thats what i thought.
    This is the Dlookup :
    Code:
    Dlookup("["Tijdstip";"Details";"Gebeurtenistype";"Bron"]", "AEOS_telling")
    The error is "Expected List seperator or )"

    edit..

    Tried it like this as well
    Code:
    DLookup(["Tijdstip";"Details";"Gebeurtenistype";"Bron"], "AEOS_telling")
    Then im getting that acces cant find the field name im referring to

  4. #4
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368
    I made a workaround, im telling the import wizard not to use field headers.
    Thus the first record is unusable. But i will just delete that record programaticly.

    Still wondering if my question could be overcome though

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Your expression syntax is wrong. There are only 3 arguments and the structure is:

    DLookup("[fieldname]", "[tablename]", "[anotherfieldname] = something")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368
    So it needs the where clause even if i dont use it ?

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    No, the where argument is optional.

    Without it the expression will return value from first record. Why would you want value from first record?

    There can be only 1 field in the target field argument, not 4. You can concatenate the fields but what does this serve?

    DLookup("[Tijdstip] & [Details] & [Gebeurtenistype] & [Bron]", "AEOS_telling")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368
    I wanted the first record actually, because the rest of the records return the same value (in that field).
    The reason i want the field to exist is because this returns the true value of the file. Not its creation date, but the data the other field holds.

    the fieldname "Tijdstip";"Details";"Gebeurtenistype";"Bron" is actually one field. And access created it, strange right ?

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Access created fieldname with quote marks and semicolons? Never seen that so just tried to build one manually and it did accept those characters. Had to do double up the quote marks in the DLookup so they would be accepted as literal text and not special characters.

    DLookup("[""Tijdstip"";""Details"";""Gebeurtenistype"";""Bro n""]", "AEOS_telling")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 06-26-2015, 08:55 PM
  2. Replies: 2
    Last Post: 06-25-2015, 10:08 PM
  3. Replies: 17
    Last Post: 03-16-2014, 10:52 PM
  4. Replies: 3
    Last Post: 12-27-2013, 02:33 PM
  5. Replies: 1
    Last Post: 03-03-2012, 10:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums