Results 1 to 3 of 3
  1. #1
    tcox's Avatar
    tcox is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Oct 2015
    Posts
    46

    Set a row in query to .Enabled = False

    The Parts Check in tab has a query that brings up all parts that are checked out.
    A supervisor then checks in the parts by clicking on the hyperlink.
    This calls a procedure that sets the parts status to IN, and records the date time and initials of the person who checked in the part.

    The issue is, I need the hyperlink to become inactive after its been clicked. I cant have that code execute again.
    My code currently sets the entire column as .Enabled = False
    How do I set a row in a query to .Enabled = False?

    Code:
    Option Compare Database
    
    Private Sub Status_Click()
    Dim Str_PartNameConcat As String
    Dim Str_Initials As String
    
    'Create string for Initials
    Str_Initials = Forms![Navigation_Main]![NavigationSubform].Form![txt_CheckInInitials].Value
    'Create string for entering into Parts Checkin Table
    Str_PartNameConcat = [Part_Set] & ", " & [Size] & ", " & [Machine_Type]
    
    'Update Parts_Set table to "IN"
    CurrentDb.Execute "UPDATE T_Part_Sets SET [Status] = '" & "IN" & "' Where Part_Sets_ID = " & Me.Part_Sets_ID
    'Insert record into Parts Checkin table
    CurrentDb.Execute "INSERT INTO T_Part_CheckIn (Initials, [Part_Set]) VALUES ('" & Str_Initials & "', '" & Str_PartNameConcat & "')"
    
    'Disable row so it cannot be clicked again.
    Me!Status.Enabled = False
    
    End Sub
    Click image for larger version. 

Name:	CheckIn.jpg 
Views:	10 
Size:	73.0 KB 
ID:	22450



    Been learning a lot!
    Thanks
    -Tevis

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Cannot do this programmatically on form in datasheet or continuous view. That's what Conditional Formatting of textbox is for.
    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
    tcox's Avatar
    tcox is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Oct 2015
    Posts
    46
    Thank you.
    got it doing exactly what I needed.

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

Similar Threads

  1. Replies: 2
    Last Post: 10-20-2015, 02:01 PM
  2. Replies: 8
    Last Post: 10-06-2014, 03:02 PM
  3. Query criteria using IIF when false
    By james28 in forum Queries
    Replies: 10
    Last Post: 03-01-2014, 03:03 PM
  4. SELECT "False" if any records are false?
    By Azurewrath in forum Queries
    Replies: 6
    Last Post: 12-21-2011, 03:36 PM
  5. Enabled = False
    By Juan4412 in forum Forms
    Replies: 2
    Last Post: 04-19-2011, 06:05 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