Results 1 to 4 of 4
  1. #1
    melonwand is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    19

    Cool Help !!!!! If, Then, Else Code in a form

    I'm using Access 2007 and I know enough to get me in trouble. I want to have a field in my form calculate based on 2 other fields that will be populated when data entered. The form is created from a Table not a Query. This is what I have and I'm not sure how to make it work or if it can work.

    Private Sub Aud_Required_AfterUpdate()
    If [ActTy] = "Consulting" Or [ActTy] = "Project Management" Then
    BudgetConsultHrs = [ActivityHours] * [AudRequired]
    Else
    BudgetConsultHrs = (0)
    End If


    End Sub

    I've been given a deadline to get this database done and this is seriously holding me back. I'd appreciate any help!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Have you tried what you have? Does it work? If not, what does it do wrong?

  3. #3
    melonwand is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    19
    I did finally get it to work. I had to change the field names to start with Me.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Great! Are you ready to use the Thread Tools and mark this thread as Solved?

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

Similar Threads

  1. Login Form Code
    By paddon in forum Programming
    Replies: 4
    Last Post: 04-08-2011, 06:48 PM
  2. Replies: 6
    Last Post: 11-05-2010, 10:11 AM
  3. Form Button with VB Code Does Nothing
    By esoikie in forum Access
    Replies: 11
    Last Post: 09-17-2010, 01:57 PM
  4. How to put code in form event.
    By rogdawg in forum Forms
    Replies: 4
    Last Post: 08-06-2010, 03:38 PM
  5. Error in form code
    By devesa in forum Access
    Replies: 3
    Last Post: 05-25-2010, 10:15 AM

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