473,883 Members | 1,666 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3941
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*****@hotmai l.com" <or*****@hotmai l.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.publi c.access
From: "Allen Browne" <AllenBro...@Se eSig.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:=acD ialog

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...@hotmai l.com> wrote in message

news:11******** **************@ f14g2000cwb.goo glegroups.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.publi c.access
From: "orta...@hotmai l.com" <orta...@hotmai l.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.publi c.access
From: "orta...@hotmai l.com" <orta...@hotmai l.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_Clic k()
On Error GoTo Err_Command350_ Click

Dim stDocName As String
Dim stLinkCriteria As String

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

stDocName = "paperpopup frm"
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
5657
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 to the appropriate mode and test the html form it gave me an 500 internel server error. I really need it to be done soon, I would not post here before I test it as much as I can,
5
6097
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 Internet. Specifically, marking up a document that will contain multiple related form controls (intended exclusively for client-side scripting) that would never be intended to be submitted. I realise that that concept is a non-starter in an Internet...
4
2141
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 same amount of Line Items. If I have all 20 Line Items, it works great. var sub1 = form.Line_Item_Subtotal1.value var sub2 = form.Line_Item_Subtotal2.value var sub3 = form.Line_Item_Subtotal3.value var sub4 = form.Line_Item_Subtotal4.value
25
10292
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 data in each record, which includes the ID of the father and the mother (who also have records in the table). One record per form. I have a Tab Control in the form, and in one of the tabs I have a subform (sfmSiblings) in which I wish to list...
19
3614
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 thing you know ;-) After discovering that access 2000 support form properties (I'm a
11
18854
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 they are too big and wind up covering up some of the fields on the main form. Is there any good code out there that works in a similar fashion that will also either a) stretch the form width wise on widescreens or b), rely on height rather than...
5
73235
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
3235
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
4587
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 forum). I don't use server controls in it (apart from Page). The problem occurs on the page where visitor can post a new messages. Basically, it's a form with couple of
0
9940
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9792
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10742
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10415
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7971
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7126
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5797
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4220
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3232
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.