Results 1 to 3 of 3
  1. #1
    gangel is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    194

    input mask causing strings unexpected in vba/sql

    Sorry for the seemingly stupoid title, but i have a basic question:

    I have an input mask for a BSB (banking code in australia)

    The BSB is in the format of 123-456

    So i have 000\-000 as my input mask.



    The table fills well and the input mask shows the right thing (___-___) but when i use vba the number is returned as 123456 and the dash is gone...

    Sooooo what am i doing wrong!!!?

    Gangel

  2. #2
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    Sooooo what am i doing wrong!!!?
    in principle nothing. Just a misunderstanding about how it works.

    Your data is stored as a number but 'presented' as a string using the format and/or input mask properties. So in your vba and sql you would use for example

    WHERE BSB=123456

    but to present it in a query you would use

    BSBFormatted: format(BSB,"000-000")

    or use the format property of your BSB control on a form or report

  3. #3
    gangel is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    194
    great thanks ajx, that helps

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

Similar Threads

  1. Input Mask
    By PRHoff in forum Access
    Replies: 2
    Last Post: 02-19-2015, 09:00 AM
  2. Input Mask
    By kdbailey in forum Access
    Replies: 4
    Last Post: 12-19-2014, 08:11 AM
  3. Input mask
    By scorpion99 in forum Access
    Replies: 4
    Last Post: 02-21-2014, 02:18 AM
  4. input mask
    By slimjen in forum Forms
    Replies: 7
    Last Post: 10-07-2013, 03:20 PM
  5. Input Mask
    By qbc in forum Access
    Replies: 2
    Last Post: 01-20-2012, 03:27 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