473,395 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Rapainting a form

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
5 3910
Was the hound silent?

Jan 25 '06 #2
?????????????????????????????????
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John | last post by:
Dear all, It been more than 3 days I am trying to debug this program, I interpret it using activePerl and it is giving (perl -wc code_process.pl) no error syntax but when I put it online, change...
5
by: Richard Cornford | last post by:
I am interested in hearing opinions on the semantic meaning of FORM (elements) in HTML. I have to start of apologising because this question arose in a context that is not applicable to the...
4
by: Targa | last post by:
Trying to total some price fields in a form but doesnt work when all the referenced form fields dont exisit. This is for an invoice - pulled prom a database and the form doesnt always contain the...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
19
by: Raposa Velha | last post by:
Hello to all! Does any of you want to comment the approach I implement for instantiating a form? A description and an example follow. Cheers, RV jmclopesAThotmail.com replace the AT with the...
11
by: Jozef | last post by:
I have some old code that I use from the Access 95 Developers handbook. The code works very well, with the exception that it doesn't seem to recognize wide screens, and sizes tab controls so that...
5
by: RAJ | last post by:
hi plz tell me how to know "how window is going to close"... i have to right code for X button of forms... plz telll me thanks bye
6
by: Gary Miller | last post by:
Does anyone know how to detect a modeless form on closing by the form that invoked the modeless form? form.Show();
4
by: Alex Sibilev | last post by:
Hello, I have a really weird problem I've been trying to solve it without any luck for the last couple of hours :( I'm writing a "conference board" application (quite similar to ASP.NET...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.