Results 1 to 3 of 3
  1. #1
    Renee R is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Apr 2014
    Posts
    11

    Button that fills in a specific value

    Hi. On my form, I have several fields that contain information about an appointment (time, scheddate). I am trying to track those who don't show up to their appointments. Thus, on my form, I have a button [NoShow]. When someone doesn't show up, you click that button, it opens a pop-up form [MarkNoShow] with the relevant information from the first form, you confirm that you want to mark them as a no-show, then it saves everything into a second table. And, because they don't have an appointment anymore, it erases the appointment information from the first form.

    When someone is marked as a no show, I want to send them a no show letter. On my form, I have a combobox [LetterType]. I want that field filled in with "No Show."

    Everything works perfectly except filling in the field with "No Show." I know I have the syntax wrong... it is a combobox. I've tried = "No show" and = 3 (the value in the lookup). But, neither works. Any suggestions?

    Private Sub NoShow_Click()
    Dim DocName As String
    DocName = "MarkNoShow"
    'I use acAdd, you may want acEdit here...
    DoCmd.OpenForm DocName, , , , acAdd
    'Set Defaults for Approver's Id & other stuff...
    Forms![MarkNoShow]![VetName] = Me.VetName
    Forms![MarkNoShow]![Last4] = Me.Last4
    Forms![MarkNoShow]![Location] = Me.Location
    Forms![MarkNoShow]![Time] = Me.Time
    Forms![MarkNoShow]![When] = Me.SchedDate
    Forms![MarkNoShow]![GC] = Me.GC_1
    Me.Time = Null
    Me.SchedDate = Null


    Me.GC_1 = Null
    Me.GC_2 = Null
    Me.LetterType = "No show"
    Detail.BackColor = RGB(230, 224, 236)
    InfoMessage.Caption = "You have modified this record. " & _
    "If you move to another record, your changes will be aplied. " & _
    "To cancel your changes, hit the Esc key."
    End Sub

    Thanks!
    Renee

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    Personally, I would have come up with a db design that didn't require 'moving' this record, such as just marking a yes/no field for the non-appearance. Or perhaps a text field and combobox with choices of descriptions for appointment resolution (NoShow, Referral, Reschedule).

    The issue is the destination field type and whether or not grabbing the correct value from combobox. This can be confusing if the combobox is a multi-column with lookup alias.
    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.

  3. #3
    Renee R is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Apr 2014
    Posts
    11
    I figured it out...

    LetterType.Value = 4

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

Similar Threads

  1. Replies: 1
    Last Post: 07-26-2013, 12:20 PM
  2. Replies: 1
    Last Post: 07-17-2013, 02:02 PM
  3. Replies: 3
    Last Post: 02-27-2013, 06:11 PM
  4. Combo Box Fills another field
    By tcheck in forum Access
    Replies: 7
    Last Post: 06-30-2011, 11:49 AM
  5. Button to Open a Specific Folder
    By dnelms in forum Programming
    Replies: 1
    Last Post: 04-08-2011, 10:05 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