Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    justphilip2003 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2013
    Location
    Ohio
    Posts
    125

    Form unbound field control problem?

    I have a Form “Gallery” with an unbound field “Select_Nr”. There is an Event Procedure


    “Private SubSelect_Nr_Click()” that is intended to be used to fetch data from Table “Carving”. When I navigate the form through field "Select_Nr", nothing happens. I’ve used Toggle break points hoping to trap the problem in the event procedure to no avail; it is like it never gets executed. I suspect a control definition problem but I can’t figure it out. Can someone make an approach suggestion for solving this problem? TIA Phil
    Last edited by justphilip2003; 03-22-2013 at 02:00 PM. Reason: unbound field control

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    You are using the form Click event? Why not use the textbox AfterUpdate event instead?

    Make sure the event property has [Event Procedure] showing.
    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
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by justphilip2003 View Post

    ...There is an Event Procedure “Private Sub Select_Nr_Click()” that is intended to be used to fetch data from Table “Carving”. When I navigate the form through field "Select_Nr", nothing happens...
    Maybe I'm not understanding your post, but 'Navigate the form through field Select_Nr' generally implies using the <Tab> Key to move through Controls on a Form; is that what you're referring to, here? If so, the OnClick event is not supposed to execute on Tabbing to the Control. OnClick will only execute if you actually click into the Control. To get code to fire when Tabbing into a Control try the OnEnter or GotFocus event.

    Common sense would dictate that the GotFocus event would fire regardless of how you moved into the Control, but this does not always work in all versions of Access.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    justphilip2003 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2013
    Location
    Ohio
    Posts
    125
    I changed the event from OnClick to AfterUpdate and I am now triggering error messages in the event procedure. I am depressing the enter key to trigger the event. I now have the problem of using the value keyed into Select_Nr. My table has the field CarvingNR with that I need to match in the table using Select_Nr; I tried "Set CarvingNR = Forms!Gallery.Select_Nr" it resulted in the message "Invalid use of property" I also tried "CarvingNR = Forms!Gallery.Select_Nr" it resulted in the message "You can't assign a value to this object." So how is done? Once I locate the matched CarvingNR the recorded data can be displayed. TIA Phil

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Is purpose of this control to search for a record? First, the control used to input filter criteria cannot be bound. Second, setting Select_Nr to a value will not find record or retrieve data from anywhere.

    Parameterized query is one method for finding record http://datapigtechnologies.com/flash...tomfilter.html

    More than one way to use VBA for locating record.
    http://windowssecrets.com/forums/sho...orm-(2000-2003)
    http://msdn.microsoft.com/en-us/libr...ffice.11).aspx

    If purpose of control is to enter a value into record, then the control should be bound to field and the data will pass directly into table. If you want to view data from a lookup table then either use a combobox with a RowSource that has the additional fields or include the lookup table in the form's RecordSource and bind textboxes to the fields and set them as Locked Yes, TabStop No.
    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.

  6. #6
    justphilip2003 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2013
    Location
    Ohio
    Posts
    125
    I watched the video; it was informative but I can' see how to use it, no comboBox is envolved here. The purpose of the logic is to use the unbound field Select_Nr to find a match in the Table column CarvingNR, then to use this record to display on the form. The video used a Query and filter; these might fit? Would this work: {StrCriteria= "[CarvingNR] = Select_Nr} {Recordset.FindFirst StrCriteria}? I am not sure how to set up StrCriteria logic prior to launching it. A query with a filter to grab all of the desired record data? TIA Phil

  7. #7
    justphilip2003 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2013
    Location
    Ohio
    Posts
    125
    CombBox logic requires selecting an entry from the drop down menu; I could have upwards of 1,900 possible unique selections in the column under CarvingNR. A solution that allows the user to key in the desired number is needed. I will review the other videos for ideas. TIA Phil

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Can type into combobox. Combobox has AutoExpand property. As user types in combobox, it will fill in the box with matching value.

    However, the technique demonstrated by DataPig video will work with input into textbox.

    The advantage with combobox is user can be limited to values that are in the list.
    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.

  9. #9
    justphilip2003 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2013
    Location
    Ohio
    Posts
    125
    I've removed the oll TextBox and incorporated the ComboBox, Query and it works fine. I have one more facet to code, the jpeg Picture display, but I'm not sure about several things: placement of code in: Private Sub Clear_Filter_Click()
    On Error GoTo Err_Clear_Filter_Click
    Me.Select_CrNr.Value = ""
    Me.Requery
    DoCmd.JPEG_Display() <== Bad code and how to code a Do execute, Perform an outside routine. I wish to access this same routine from another ComboBox which will cause other views to be shown. JPEG_Display() format the file name and with picture version and displays it. Or would the performed routine be better executed from: Private Sub Select_CrNr_AfterUpdate()
    Me.Requery

    End Sub
    TIA Phil

  10. #10
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I have no idea what you just said. What exactly are you trying to do with a jpeg? What is JPEG_Display()?
    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.

  11. #11
    justphilip2003 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2013
    Location
    Ohio
    Posts
    125
    "Private Sub JPEG_Display(") was to be a subroutine that could be performed from more than one other Sub Event Procedure like "Private Sub Clear_Filter_Click()" or "Private Sub Select_CrNr_AfterUpdate()". These two private sub routine were developed in DataPig Technologies ComboBox and Filter clear procedures. The first question: where should I place the jpeg display execute assuming an external routine can be invoked from within an Event Procedure? I think in the AfterUpdate one. The second question: how does one code the external subroutine name and how do you code an execute of that routine? I know am stuck with oldterminology from my Cobol days. Is this a case for a one time per picture display DoEvent? TIA Phil

  12. #12
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I still don't know what you are trying to do with images. If I understood what you wanted to do I might be able advise.

    There is an Image control that can be used to dynamically display images with records.

    What do you mean by 'external' routine? What makes the routine 'external'?
    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.

  13. #13
    justphilip2003 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2013
    Location
    Ohio
    Posts
    125
    The comboBox logic found the record associated with the selected CarvingNR. One of the fields contains part of the Jpeg file name (for example CrNr181v1). The code in the questioned external even(?) procedure "Private Sub JPEG_Display()" assembles the complete path name" to fetch and display the image on the Form. Occasionally there are multiple views of the carving and the string CrNr181v1 will be manipulated to be "v2", "v3", etc until not found. The logic you provided for the not found will cause a standard not picture to be displayed. The extended image display will be started with another button, giving the person the option to find a new carving or more views of the current carving. I have the logic for building the path string, all I need is how to get to it. Tia Phil

  14. #14
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Try the ControlSource of Image control. The ControlSource of Image control can be attachment field, text field storing path string, or an expression that constructs the path string. A function can be in the expression. Or VBA can set the ControlSource property.
    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.

  15. #15
    justphilip2003 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2013
    Location
    Ohio
    Posts
    125
    June7 I wish to thank you for all of the help you gave me. In reading about ControlSource of Image control I stumbled across the "Call" command (it apparently acts like the Cobol "Perform" command. I am getting proper image displays except for not founds. I do believe I can finish it from here. Thanks to all others who lent a hand. Phil

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Unbound field control Problem
    By justphilip2003 in forum Programming
    Replies: 1
    Last Post: 03-20-2013, 09:10 AM
  2. Display record in unbound text field on form
    By MAABDOLAT in forum Forms
    Replies: 1
    Last Post: 07-25-2012, 06:10 PM
  3. Formatting Unbound Control
    By SltPhx in forum Forms
    Replies: 12
    Last Post: 08-17-2011, 01:49 PM
  4. Replies: 1
    Last Post: 07-11-2011, 04:35 AM
  5. Replies: 6
    Last Post: 12-01-2010, 06:52 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