By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,871 Members | 2,575 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,871 IT Pros & Developers. It's quick & easy.

Rapainting a form

P: n/a
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?????

Jan 25 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Was the hound silent?

Jan 25 '06 #2

P: n/a
?????????????????????????????????
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.

Jan 26 '06 #3

P: n/a
On 26 Jan 2006 05:46:46 -0800, "or*****@hotmail.com" <or*****@hotmail.com> wrote:
?????????????????????????????????
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
Jan 26 '06 #4

P: n/a
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.

Jan 27 '06 #5

P: n/a
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:11**********************@f14g2000cwb.googlegr oups.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
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?


3. or*****@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. or*****@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

Jan 29 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.