Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2008
    Location
    Middletown, NJ
    Posts
    9

    If name = test1 then let , NOT WORKING ?

    Hi, all can someone help me with a problem that I have.


    Working in Access / Build Event

    In my form I have two fields one is call ( name ) it is a text field and a lookup.
    The other one is call ( Point1 ) it is a text field.


    Private Sub number_BeforeUpdate(Cancel As Integer)
    If name = Test1 Then Let point1 = 10
    If name = Test2 Then Let point1 = 20
    If name = Test3 Then Let point1 = 30
    If name = Test4 Then Let point1 = 40

    End Sub

    Why this is not working.???????


    Thank You

    Johnny C

  2. #2
    Join Date
    Jan 2009
    Posts
    2
    Not sure if this will work but try:

    Private Sub number_BeforeUpdate(Cancel As Integer)
    If name = Test1 Then Let point1 = 10
    ElseIf name = Test2 Then Let point1 = 20
    ElseIf name = Test3 Then Let point1 = 30
    ElseIf name = Test4 Then Let point1 = 40
    End if
    End Sub



    Quote Originally Posted by caljohn527 View Post
    Hi, all can someone help me with a problem that I have.
    Working in Access / Build Event

    In my form I have two fields one is call ( name ) it is a text field and a lookup.
    The other one is call ( Point1 ) it is a text field.


    Private Sub number_BeforeUpdate(Cancel As Integer)
    If name = Test1 Then Let point1 = 10
    If name = Test2 Then Let point1 = 20
    If name = Test3 Then Let point1 = 30
    If name = Test4 Then Let point1 = 40

    End Sub

    Why this is not working.???????


    Thank You

    Johnny C

  3. #3
    jya is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2007
    Location
    Chicagoland
    Posts
    109
    I am going off what is written, but I wouldn't use 'name' as a field name and I would use quotes when comparing against a text field.

    ex. If TestName = "Test1" then ...

  4. #4
    Join Date
    Oct 2008
    Location
    Middletown, NJ
    Posts
    9

    Smile Thank You But Not Working...

    Thank You butterflies88 and Jya for your help but unfortunately it is not working, but here is the expression that I am using. And it is not working.

    Private Sub number_BeforeUpdate(Cancel As Integer)
    If Combo206 = Poor Then Let emppoint1 = 10
    If Combo206 = Good Then Let emppoint1 = 20
    If Combo206 = Fair Then Let emppoint1 = 30
    If Combo206 = Excellent Then Let emppoint1 = 40

    End Sub

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

Similar Threads

  1. Replies: 0
    Last Post: 01-06-2009, 03:27 PM
  2. public instead of dim not working
    By DKY in forum Access
    Replies: 1
    Last Post: 10-14-2008, 11:42 AM
  3. Working with Two Combo boxs
    By Della Smith in forum Database Design
    Replies: 2
    Last Post: 08-01-2008, 02:52 PM
  4. Import Wizard Not Working
    By cjh2001 in forum Import/Export Data
    Replies: 1
    Last Post: 01-24-2008, 06:33 PM
  5. calculated sum not working!
    By Linda Gamble in forum Access
    Replies: 1
    Last Post: 10-12-2007, 06:38 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