Results 1 to 2 of 2
  1. #1
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496

    evaluate an unbound control value as it is being entered

    stumped

    trying to check the value of an unbound control as it is being entered (vs. before / after update, lost focus...);
    essentially as soon as the user starts to enter printing characters into the textbox



    Code:
    Private Sub txtTemplateName_Change(frm As Form)
        Dim blnIsNew As Boolean
        With frm
            blnIsNew = IsNull(DLookup("[TemplateID]", "tblLuminaireTemplates", "[LuminaireType]= '" & .cboLuminaireType & "' AND [TemplateName] = '" & Trim(.txtTemplateName) & "'"))
            If blnIsNew Then
                    .cmdSaveTemplate.Enabled = True
            End If
         End With
    End Sub
    as always, with appreciation in advance,
    m.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    if you are using the change event you need to use the .text property

    Trim(.txtTemplateName.text)

    you are aware the change event fires every time a character is entered or deleted? so your dlookup will be working overtime

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

Similar Threads

  1. Unbound control into report
    By Thompyt in forum Reports
    Replies: 2
    Last Post: 12-09-2019, 06:10 PM
  2. Replies: 8
    Last Post: 06-19-2015, 02:19 AM
  3. Replies: 6
    Last Post: 10-21-2014, 08:45 AM
  4. Formatting Unbound Control
    By SltPhx in forum Forms
    Replies: 12
    Last Post: 08-17-2011, 01:49 PM
  5. Replies: 1
    Last Post: 07-11-2011, 04:35 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