Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / January 2006

Tip: Looking for answers? Try searching our database.

Rapainting a form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ortaias@hotmail.com - 25 Jan 2006 02:58 GMT
I have a form which calls up a second form for purposes of data entry.
When closing the data entry form and returning to the main form, things
don't work as expected.

When I return to the main form, I trigger the on acitvate event to run
a macro.  I can use the Dlookup function to update my fields, which is
OK.  However, I intitially tried to use the Repaint Object command to
repaint the form.  That did not work.  Though I solved the problem with
Dlookup, I would like to know why Repaint Object did not work?????
Lyle Fairfield - 25 Jan 2006 03:04 GMT
Was the hound silent?
ortaias@hotmail.com - 26 Jan 2006 13:46 GMT
?????????????????????????????????
I am just trying to understand why certain things work and others
don't.  It appears that the REPAINT command does not force the controls
to update to current data in the underlying table, it simply repaints
the form based on values held by the form. DLOOKUP does update the
control, but this approach does not seem to be the elegent solution.
Wayne Gillespie - 26 Jan 2006 13:58 GMT
>?????????????????????????????????
>I am just trying to understand why certain things work and others
>don't.  It appears that the REPAINT command does not force the controls
>to update to current data in the underlying table, it simply repaints
>the form based on values held by the form. DLOOKUP does update the
>control, but this approach does not seem to be the elegent solution.

Try Me.Refresh

Wayne Gillespie
Gosford NSW Australia
ortaias@hotmail.com - 27 Jan 2006 20:06 GMT
Thanks.  I am still thinking this through.  I will have to give
"Refresh" a try.  Dlookup is working, but I will wait until I solve my
popup form issue.  The popup form works as expected, except for a
specific situation.  I am still trying to ferret it out.
ortaias@hotmail.com - 29 Jan 2006 15:16 GMT
Below is a post related to what I was trying to do, that solved most of
the problem.  I will also be testing the use of the refresh method.
Me.Refresh.
---------------------------------------------------------------------------------------------------------------------------
The pop up form normally works as expected in updating the underlying
form.  However, there is an issue.  The pop up form is linked to a
control and displays the drop-down-list in a much-improved format. The
problem occurs when one changes another control on the form and then
attempts to use the pop up form.  Under that scenario, the pop up form
won't update the control it is linked to.  Additionally, I noticed that
if I try to move to a different record, I receive the error message
"write conflict, another user has changed the record".  It would appear
that ACCESS does not believe that the same user is using both forms.

This problem can be partially resolved by making the underlying form's
edit property to locking the current record. This doesn't update the
control.  The good news is that I do not get the "write conflict" error
message. Additionally you can see that the pup up form did not work
since it won't accept your clicks. Changes to other controls continue
to work as expected.  Until this problem is solved I can add a note to
the pop up form advising the user not to click on another control after
activating the pop up form.

I attempted to solve this problem through a save the underlying form
command when closing the pop up form and requerying the linked control.
This didn't work.

In summary, the pop up form works just as long as you do not make other
changes to the form. Any reason why changing another control would
prevent the pop up form from working correctly? What would be the
solution?

2. Allen Browne
    Jan 28, 3:52 am   show options
Newsgroups: microsoft.public.access
From: "Allen Browne" <AllenBro...@SeeSig.Invalid> - Find messages by
this author
Date: Sat, 28 Jan 2006 16:52:52 +0800
Local: Sat, Jan 28 2006 3:52 am
Subject: Re: Pop Up form fails to update underlying form
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Report Abuse

Naturally enough, if the first form is dirty at the time when you pop
up
your 2nd form and you edit the same record there, you will get the
conflict
dialog.

You worked around the issue by setting the first form's properties so
editing is not possible there. You could also avoid the situation by
saving
any changes in the first form before opening the popup, e.g.:
   If Me.Dirty Then Me.Dirty = False
   DoCmd.OpenForm "MyPopup", WindowMode:=acDialog

But, as you found, the problem still arises where 2 copies of the same
data
is shown in different forms at once. Particularly if memo fields are
involved, this can be hard to avoid. You might be able to solve the
issue by
binding the first form to a query that excludes the memo fields, so
they are
in the 2nd form only.

The other alternative is to make the 2nd form unbound. When it pops up,
it
reads the values from the first form's controls into its controls. When
you
click the Ok button, it writes the values back into the first form's
controls (if there were any changes.) Since it was not actually bound
to
anything in the first place, you avoid the whole scenario of Access
trying
to manage simultaneous editing in multiple copies of the data.

At the very simplest level, that's what the Zoom Box does. You can
press
Shift+F2 in any control (including those bound to a memo), and edit the
data
in the pop-up without triggering concurrency errors.

--
Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<orta...@hotmail.com> wrote in message

news:1138408914.691312.206760@f14g2000cwb.googlegroups.com...

- Hide quoted text -
- Show quoted text -

> The pop up form normally works as expected in updating the underlying
> form.  However, there is an issue.  The pop up form is linked to a
[quoted text clipped - 5 lines]
> "write conflict, another user has changed the record".  It would appear
> that ACCESS does not believe that the same user is using both forms.

> This problem can be partially resolved by making the underlying form's
> edit property to locking the current record. This doesn't update the
[quoted text clipped - 4 lines]
> the pop up form advising the user not to click on another control after
> activating the pop up form.

> I attempted to solve this problem through a save the underlying form
> command when closing the pop up form and requerying the linked control.
> This didn't work.

> In summary, the pop up form works just as long as you do not make other
> changes to the form. Any reason why changing another control would
> prevent the pop up form from working correctly? What would be the
> solution?

3. ortaias@hotmail.com
    Jan 28, 10:26 am   show options
Newsgroups: microsoft.public.access
From: "orta...@hotmail.com" <orta...@hotmail.com> - Find messages by
this author
Date: 28 Jan 2006 07:26:48 -0800
Local: Sat, Jan 28 2006 10:26 am
Subject: Re: Pop Up form fails to update underlying form
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Remove | Report Abuse

Thank you.  I will experiment with this on Monday.

Reply

4. ortaias@hotmail.com
    Jan 28, 2:22 pm   show options
Newsgroups: microsoft.public.access
From: "orta...@hotmail.com" <orta...@hotmail.com> - Find messages by
this author
Date: 28 Jan 2006 11:22:07 -0800
Local: Sat, Jan 28 2006 2:22 pm
Subject: Re: Pop Up form fails to update underlying form
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Remove | Report Abuse

I went in to work, anyway.  Your suggestion worked. Adding the>> If
Me.Dirty Then Me.Dirty = False << Code fixed the problem.

Private Sub Command350_Click()
On Error GoTo Err_Command350_Click

   Dim stDocName As String
   Dim stLinkCriteria As String

   DoCmd.Save
   If Me.Dirty Then Me.Dirty = False

   stDocName = "paperpopupfrm"
   stLinkCriteria = "[projectnum]=" & Me![Text119]
   DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormEdit, acDialog

Exit_Command350_Click:
   Exit Sub

Err_Command350_Click:
   MsgBox Err.Description
   Resume Exit_Command350_Click

End Sub

Reply
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.