Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  1. #16
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430


    why it is accepting a numeric value in text
    Because you are referring to a column in the combo - all columns are text.

    Even if you referred to the control value by using

    If RST.Fields(3) = Me.castcode Then

    you will still get a text value - because the control is unbound and cannot determine the datatype so it defaults to text

    if you want a numeric value use the cLng function to convert it to a number, or bind the control to a numeric field

  2. #17
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by CJ_London View Post
    Because you are referring to a column in the combo - all columns are text.

    Even if you referred to the control value by using

    If RST.Fields(3) = Me.castcode Then

    you will still get a text value - because the control is unbound and cannot determine the datatype so it defaults to text

    if you want a numeric value use the cLng function to convert it to a number, or bind the control to a numeric field
    Thank you very much for clearing the confusion.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Coding Problem - Too few parameters
    By JJPetersen1 in forum Programming
    Replies: 2
    Last Post: 08-16-2023, 10:32 AM
  2. Replies: 19
    Last Post: 04-12-2020, 12:51 PM
  3. Problem Coding this IIF statement
    By wcrimi in forum Queries
    Replies: 4
    Last Post: 03-20-2017, 09:33 AM
  4. Coding problem with Exit button
    By NightWalker in forum Programming
    Replies: 11
    Last Post: 06-06-2016, 01:05 PM
  5. Coding problem.
    By cheyanne in forum Forms
    Replies: 3
    Last Post: 05-19-2012, 05:57 AM

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