Results 1 to 10 of 10
  1. #1
    fabiobarreto10 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2011
    Posts
    169

    fields automatically filled in a new record

    friends


    I'm trying to use a function to add a value to a subform field by selecting a value from a list box in another field. But does not work with a new record. Only when I leave and go back to record again.


    Someone has gone through a similar situation, you can help me.


    Thank you.

  2. #2
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    So your function does add the value, it just doesn't show up. Have you tried the Repaint or the Refresh commands?? See Help for those two commands.

  3. #3
    fabiobarreto10 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2011
    Posts
    169
    ssanfu, thanks for helping.

    The function works perfectly, but only when I repeat again the change of the field with the same value.
    For example, I change the field and leave the record, has no effect.
    When I go back and put the same value in the field, I get the following message:

    Write conflict

    This record has been changed by another user since you started editing it.
    If you save the record, the changes will be overwritten by another user.
    If you copy the changes to the Clipboard, you can check the entered values
    by another user and paste your changes back if you
    decide to make changes.

    Save Record
    Copy to Clipboard
    discard Changes

    when I select to copy to ... function works perfectly and the other in the same field
    Registration is completed automatically.

    I'm trying not to appear this message and work with a single trial, not two.

    Thank you.

  4. #4
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    Sounds like you need Me.Refresh or Me.Requery after updating the record like ssanfu suggested.

  5. #5
    fabiobarreto10 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2011
    Posts
    169
    I use the requery or refresh with which field? or the subform?

  6. #6
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    Set the refresh/requery in the subform after updating the field you mentioned in your second post.

  7. #7
    fabiobarreto10 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2011
    Posts
    169
    Friends, it worked.

    In the event after updating the field has a call to another procedure, I put in Me.Refresh
    another procedure and it worked like I wanted to thank you very much.

    Just how do I indicate to the access that he should change the date only on the current record, and not in others
    records with the same value?

    For example, I have this Sql:

    Sql = "Update TblPassosStatus set TblPassosStatus.[dataprogramada]" _
    & "= #" & Format(req, "yyyy/mm/dd") & "# where (TblPassosStatus.Passo = " & p & ")" _
    & "and (TblPassosStatus.CodProduto=" & Me.CodProduto & ")"
    Me.Refresh

    Passo = step. p = code step.
    Each step has a code.
    In my subform I have the same pitch a few rows, what criteria do I add
    this sql to inform the access I need to add the date in the field where the current record is
    being changed, not all records which are the same step.

    Thank you again.

  8. #8
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    Quote Originally Posted by fabiobarreto10 View Post
    Just how do I indicate to the access that he should change the date only on the current record, and not in others
    records with the same value?
    Under the "Other" tab in the Property Sheet, enter directions in the "ControlTip Text" section. When the user hovers over the box with his mouse, the text will appear.

  9. #9
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Quote Originally Posted by fabiobarreto10 View Post
    In my subform I have the same pitch a few rows, what criteria do I add
    this sql to inform the access I need to add the date in the field where the current record is
    being changed, not all records which are the same step.
    How do you identify the current record?
    What is the PK? An Autonumber?

    Include the PK in the SQL string to change only the current record.

  10. #10
    fabiobarreto10 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2011
    Posts
    169
    ssanfu and TG_W, thank you.
    Just added this line of code in the sql and it worked.
    & "and (TblPassosStatus.CodPassosStatus=" & CodPassosStatus & ")"


    I have a doubt in move.last, but I'll mark this as solved and open a new one.


    Thank you for your attention and help.

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

Similar Threads

  1. How do I see only fields that are filled?
    By fabiobarreto10 in forum Forms
    Replies: 56
    Last Post: 01-01-2012, 09:51 PM
  2. Replies: 5
    Last Post: 07-19-2011, 11:56 AM
  3. Field automatically filled
    By Douglasrac in forum Forms
    Replies: 3
    Last Post: 02-15-2011, 11:33 AM
  4. query with fields that cannot be filled in
    By durstlaw in forum Queries
    Replies: 3
    Last Post: 07-23-2010, 12:03 AM
  5. Replies: 4
    Last Post: 01-19-2010, 05:36 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