Results 1 to 10 of 10
  1. #1
    MarcinM is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Posts
    11

    Filtering fields of table by query


    Hi!
    I am a student and I've just started to work with the MS Access and databases.


    I am wondering if it is possible to filter the fields of table and display only specific information from that specific field. For example: The database (*.mdb file) is created automatically by the software (EPLAN Electric). There are columns with filds like "de_DE@Verbindungsleitung;pl_PL@Kabel laczacy;en_EN@Connecting cable;en_US@Connecting cable;" But I would like to display in query/table filed only text starting from "en_EN@*" or "??_??@*" or display nothing...

    I know that it is possible to display only rows which contain this text, but how can I get rid of fields from unwanted words...?

    I would be very gratefull if you explain me that..

    Best regards,

    Marcin

    P.S. I cannot change original table of database because the parent-program (EPLAN Electric) will not recognize this database... And additionally data base is updated via EPLAN so every new field should be filtered in this way...

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    in a continuous form, in a filter textbox, txtFilter
    on the AFTERUPDATE() event of the text box, start the filter:

    me.filter = "LIKE " & txtFiler & "*"
    or
    me.filter = "LIKE *" & txtFiler & "*"
    me.FilterON = true

  3. #3
    MarcinM is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Posts
    11
    Quote Originally Posted by ranman256 View Post
    in a continuous form, in a filter textbox, txtFilter
    on the AFTERUPDATE() event of the text box, start the filter:

    me.filter = "LIKE " & txtFiler & "*"
    or
    me.filter = "LIKE *" & txtFiler & "*"
    me.FilterON = true
    First of all thank You a lot for Your fast reply!
    I don't know VBA language, so I am wondering if You could explain me, what for is every line of code... Because I am not sure if it would work properly (I don't see any 'text formula/pattern' that should be omitted before displaying text from the source table...

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    It seems that you have very little experience with database or Access or programming constructs. Here is a link to search information, but you really need to get some understanding of database and Access basics.

    You could try youtube tutorials, but some formal training would simplify/streamline your learning.

  5. #5
    MarcinM is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Posts
    11
    Yes I've just started to work with the MS Access...


    I've asked for explanation of the code because I think it does some filtering but not what I need to do...
    I need to display in continuous form fields from a table but In each of them I need to omit text starting with: "??_??@" or "de_DE@" and ending with a colon ";" and display the rest of symbols...


    I really don't know if it is possible or not, so if You could give me some clues I'd be very grateful...

    Best regards,

    Marcin

    P.S.
    Maybe You can just suggest me some functions which are able to omit displayed text without any changes in original table...
    Thanks again for replies!

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Some more tutorials:
    http://holowczak.com/programming-con...l-programmers/
    http://www.access-vba.net/introducti...ccess-vba.html

    You need string manipulation functions - Left, Right, Mid, InStr, InStrRev, Len, Replace, Split.

    So if you always want to drop the first 6 characters and the ending ";", try:

    Replace(Mid([fieldname], 7), ";", "")

    This assumes there is only one ; in the value. Consistency is critical when parsing strings. Any variation in the string structure will complicate.
    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.

  7. #7
    MarcinM is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Posts
    11
    Quote Originally Posted by June7 View Post

    You need string manipulation functions - Left, Right, Mid, InStr, InStrRev, Len, Replace, Split.

    So if you always want to drop the first 6 characters and the ending ";", try:

    Replace(Mid([fieldname], 7), ";", "")

    This assumes there is only one ; in the value. Consistency is critical when parsing strings. Any variation in the string structure will complicate.

    I would like to ask where I should made this Replace or other string manipulations function to only display what I want:


    I should change the original field with that function or
    I should save the result in other tab/variable to be able to display it in my form (in ex. in my query) or
    I can do the filtering just before the displaying in a form... in text field, before actualization of the form...?

  8. #8
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Research google/bing/youtube to find tutorials on string manipulation with MSAccess.
    There are plenty of tutorials that will lead you through string manipulation.

    You can find syntax and examples at techonthenet

  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,772
    The expression can be in query or in textbox ControlSource.
    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.

  10. #10
    MarcinM is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Posts
    11
    Thanks Everyone for Your replies!


    I've solved my problem...! I had to read more about "string manipulations". If anyone have question in similar issue please see:
    https://599cd.com/VideoPlayer/?FN=ht...ring-instr.mp4

    Thanks again,

    MarinM

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

Similar Threads

  1. Replies: 8
    Last Post: 08-12-2015, 03:06 PM
  2. Replies: 2
    Last Post: 01-31-2013, 04:41 PM
  3. Replies: 5
    Last Post: 08-07-2012, 10:12 PM
  4. Replies: 2
    Last Post: 02-20-2012, 08:32 AM
  5. Replies: 11
    Last Post: 09-15-2011, 03:52 PM

Tags for this Thread

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