Page 1 of 3 123 LastLast
Results 1 to 15 of 31
  1. #1
    fabiobarreto10 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2011
    Posts
    169

    form popup

    I made a popup form, for when a user change the value of a field, the window opens automatically.
    I created a new table: comments and also audit tables of the same table.
    I did one to many relationship, for TblPassosStatus TblComentários.
    In the event the change of the field, put the following code:


    DoCmd.OpenForm "fComentários",, "CodPassosStatus =" & Me.CodPassosStatus
    Opens normally, but the tables are not relating.
    I need a text box to show all the comments field change, the date when the user selects a particular step. I tried another sub sub. It did not work.
    I still have doubts if necessary, create the audit tables for table comments. For comments, can not be changed. I did the audit table in order to display the comments in the text box.
    I tried putting the following code to load in the event of the form for comments:
    Me.formComentarios = now ()
    It worked, but the date is not locked. If I could get the date it locks. I do not need the audit tables. For when you place the text box to display all comments for a particular step, they would already be with the dates.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    I don't not understand much of what you describe.

    What do you mean "the tables are not relating"? You mean the form is not opening to the correct records?

    Why didn't a sub work? It should if done right.

    Totally don't understand what the problem with date field is. What does 'I do not need the audit tables' mean and how is it relevent to the date issue?
    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
    fabiobarreto10 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2011
    Posts
    169
    I'll try to work out better.
    Yes, pop-up form is not opening in accordance with the record.
    I need a text box, for when the user clicks or field to focus on the scheduled date in the text box to show all comments specific step of reprogramming. This text box must show the date and what was the user of each comment. The text box needs to show all the comments in their field, each comment with the date and name of the user.
    I tried to use in place of the text box, subform, for when the user clicks the field show the comments, but did not work.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Why did not work - error message, wrong results, nothing? Can't help without having something to analyze. Too many things can be cause of issue. Need query statement, code, or the project itself with the structure you tried, even if it is failing.
    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.

  5. #5
    fabiobarreto10 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2011
    Posts
    169
    Previously on a bench test the dialog box opened and closed normally.
    Now is not wanting to close. The following message appears: Can not add or change records, it is necessary that they have a related record in table 'TblPassosStatus'. This is because the parent and child fields of the subform where the field is to be changed, open the dialog box? BD attached.
    Thank you.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    This is why popup forms can be frustrating. You open the popup but don't pass the Passo record ID that the comment should be associated with. You have a WHERE condition expression in the OpenArgs argument. All is needed here is: Me.CodPassosStatus. Also, use AfterUpdate instead of Change event.
    Private Sub DataReprogramada_AfterUpdate()
    Me!Contador = DCount("[DataReprogramada]", "audTblPassosStatusA", "[CodPassosStatus]=" & Me!CodPassosStatus)
    DoCmd.OpenForm "frmComentários", , , , , acDialog, Me.CodPassosStatus
    End Sub

    Then in the Open or Load or Current event of frmComentarios:
    If IsNull(Me.CodPassosStatus) Then Me.CodPassosStatus = Me.OpenArgs

    You have CodPassosStatus set to a default value of 0 in the table, remove this. I never set number fields with a default 0. A welcome change in 2010 is this Default Value is no longer automatically 0 when table is created. I also never allow empty strings in text fields. If no data entered, I want field to be Null.
    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.

  7. #7
    fabiobarreto10 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2011
    Posts
    169
    June7, Thanks for responding. I did exactly as you said. It seems everything works normally. How do I open the feedback form only when a change? For example, the first record of the rescheduled date field, you need not open the form for comments. Only when there are changes.
    I put the procedure date () in the form load event to popup comments, how do I get locked this date, the user can not edit it?
    You can use the DLookup () or ELookup () in order to fill the text box as all the reviews of a particular step? That is, when the user clicks on top of the rescheduled date field of a certain step, shown in the text box, all comments on this step.
    Thank you.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Change event won't work because the form opens before finish typing the date. Try this in the AfterUpdate.
    If Me.DataReprogramada.OldValue <> Me.DataReprogramada And Not IsNull(Me.DataReprogramada.OldValue) Then DoCmd.OpenForm "frmComentários", , , , , acDialog, Me.CodPassosStatus

    You need a Date/Time field in the Comment table. Set its Default Value to Date. Bind textbox to this field, set properties Locked Yes, TabStop No.

    I don't understand the question about DLookup.
    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
    fabiobarreto10 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2011
    Posts
    169
    I tried the code you sent me, but did not work. All records normally, but the form does not open popup. I tried some combinations with code you sent me but it did not work.

  10. #10
    fabiobarreto10 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2011
    Posts
    169
    Details attached

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    You are repeating the DCount. That is not the code I provided. Look at my suggestions again.
    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.

  12. #12
    fabiobarreto10 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2011
    Posts
    169
    June7, I'm sorry. I am using a translator. Sometimes the translation is not clear. You can try to tell me another way (other words)?
    Now, I put the exact code that you sent after the event update. I took the two lines of code counter, just to make a test, and still did not work.
    Before I had put the two lines of code counter for the following reason:
    If the old value was zero, the form does not open comments, but would have to count the record.
    The next time the field was changed, would run every time the piece of code that opens the form, and also the counter.
    One of the lines would run counter this case only the first time, when the old value was zero.

    Thank you.

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Take a look.

    EDIT: Purpose served, file removed.
    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.

  14. #14
    fabiobarreto10 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2011
    Posts
    169
    June7, I'm sorry again, now seems to work. I'll try to explain.
    Before testing was in line the fields. (Was changing field) But I have to leave a record to run. How do I get when I type a new date in the field and hit enter, it matches the current value and not null? (ie before they were not opening the feedback form, because every time the code was still read as zero)
    Where exactly the line of code I put the meter?

  15. #15
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Don't understand question (translation?). Did you view the project I uploaded?
    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.

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

Similar Threads

  1. Access 2003 Calender Sub Form and PopUp
    By pkstormy in forum Code Repository
    Replies: 1
    Last Post: 07-29-2012, 10:50 AM
  2. Popup form
    By triplee23 in forum Forms
    Replies: 1
    Last Post: 10-24-2010, 04:09 PM
  3. Popup Form
    By NISMOJim in forum Forms
    Replies: 1
    Last Post: 10-23-2010, 09:16 AM
  4. popup when opening a form
    By ajetrumpet in forum Forms
    Replies: 1
    Last Post: 10-08-2010, 09:33 AM
  5. Form-Subform-Popup Problem
    By TrudyD1474 in forum Forms
    Replies: 1
    Last Post: 06-10-2010, 05:36 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