473,397 Members | 2,028 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,397 software developers and data experts.

can't see new customer in control

I have in form frmworkshop one command button newcustomer.
When I click him then open frmcustomer and I can write new customer.
After closed frmcustomer I can't see new customer in control customer on form frmworkshop.
I must close and open frmworkshop if i want see new customer in control.
How can I solve this problem.
Feb 18 '08 #1
5 1501
Delerna
1,134 Expert 1GB
you will need a public function on frmworkshop that you can call from frmcustomer when it closes.

The code in the public function will simply be
Expand|Select|Wrap|Line Numbers
  1. Me.Refresh
  2.  
that code will cause the form to refresh and display the new data.
I am taking it for granted that you know something about VBA here.
Feb 18 '08 #2
you will need a public function on frmworkshop that you can call from frmcustomer when it closes.

The code in the public function will simply be
Expand|Select|Wrap|Line Numbers
  1. Me.Refresh
  2.  
that code will cause the form to refresh and display the new data.
I am taking it for granted that you know something about VBA here.
Would you like explain me how can I write public function and where I must put her in form,please.
Feb 18 '08 #3
Delerna
1,134 Expert 1GB
OK
To get to the code page of the form click the form you want and in the toolbar at the top, click the icon that has a square with a red a green and a yellow dots on it. If you hover over the icon it will say "Code" in the tooltip.

In the code page for form frmworkshop
scroll right to the end and paste this code there

Expand|Select|Wrap|Line Numbers
  1. Public Sub RefreshTheForm()
  2.    Me.Refresh
  3.    'You may need more code in here to perform other tasks
  4. End Sub
  5.  
you can actually paste the code anywhere on the code page but you must make sure you don't paste it inside another sub.

Now on the code page for the frmcustomer
scroll right to the end and paste this code there

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Unload(Cancel As Integer)
  2.    Forms.frmworkshop.RefreshTheForm()
  3. End Sub
  4.  
Now when frmcustomer unloads (ie closes) it will execute the code in the second code block above. The code there calls the sub in the first code block which refreshes your form

Not trying to be rude but may I suggest, that if you want to create really good databases, open up the access help documents goto the contents tab and have a look at the visual basic conceptual topics. Try them out and experiment.
We are always here to help you over any sticky patches, but you need to get some of the basics down for you self and the help files are pretty good for that.
Feb 18 '08 #4
OK
To get to the code page of the form click the form you want and in the toolbar at the top, click the icon that has a square with a red a green and a yellow dots on it. If you hover over the icon it will say "Code" in the tooltip.

In the code page for form frmworkshop
scroll right to the end and paste this code there

Expand|Select|Wrap|Line Numbers
  1. Public Sub RefreshTheForm()
  2.    Me.Refresh
  3.    'You may need more code in here to perform other tasks
  4. End Sub
  5.  
you can actually paste the code anywhere on the code page but you must make sure you don't paste it inside another sub.

Now on the code page for the frmcustomer
scroll right to the end and paste this code there

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Unload(Cancel As Integer)
  2.    Forms.frmworkshop.RefreshTheForm()
  3. End Sub
  4.  
Now when frmcustomer unloads (ie closes) it will execute the code in the second code block above. The code there calls the sub in the first code block which refreshes your form

Not trying to be rude but may I suggest, that if you want to create really good databases, open up the access help documents goto the contents tab and have a look at the visual basic conceptual topics. Try them out and experiment.
We are always here to help you over any sticky patches, but you need to get some of the basics down for you self and the help files are pretty good for that.
when I put you code in frmcustomer return me same error.
After write Forms. I can put only application, count,Item or parent.
If I write Forms.frmworkshop.refreshTheForm() return me error Expected:=
Feb 18 '08 #5
Delerna
1,134 Expert 1GB
OOPS getting too used to writing java script

in VBA and VB and VBScript
Expand|Select|Wrap|Line Numbers
  1. Forms.frmworkshop.RefreshTheForm()
  2.  
is the way to call a function and functions always return a value

In your case you don't want to return a value, you just want to execute a subroutine, so change it to the following.

Expand|Select|Wrap|Line Numbers
  1. Forms!frmworkshop.RefreshTheForm
  2.  
Note the absence of the brackets. Also the . changed to !
The . works but the ! is correct.
Welcome to the wonderful world of debugging, the act of fixing the silly things that programmers write while not thinking.
Feb 19 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Paul T. Rong | last post by:
Hi, everybody! There is a text box in the form, when I type a customer name, I would like the typed name to be checked whether the name matches one in the customer_name field of the...
0
by: keith | last post by:
Is there a way to clone a customer control which has a panel control in it? The panel control contains a lot of controls which were added at run time. I would like to clone the customer object...
0
by: ca___t | last post by:
Hi there: I have a task that need to write a customer control.I want to add a property to this control. This property looks like checked property of checkbox web control. My question is after...
0
by: Noel Volin | last post by:
Hi all, I have a customer server menu control that I downloaded from gotdotnet in order to learn a little more about custom controls. The problem is that everything works wonderfully if I view...
9
by: Tony Johansson | last post by:
Hello!! Assume I have a form and this form is used by two different customer. At this moment the form for the two customer is exactly the same. But assume that one customer want to have the...
1
by: Benny Ng | last post by:
Dear All, Now I met one problem in the development of my one application. I have one ASP.NET page. It's for disply the information of customer. But now I have one new requirement. It's to...
11
by: Nick Gilbert | last post by:
Hi, How can I create a custom control which will wrap its content in a header and footer? eg: Is it possible to create a .NET user control which can surround other controls? eg:...
1
by: banging | last post by:
Hi there, I have a question regarding locking of tables so that when two or more people try to write or update the mysql tables, it locks up. Basically I only want one person to write to the...
4
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Hi. I'm building an ASP.NET 2.0 web-app for a customer. The customer wants a background image that's 124k in size as the background for each page. I've recommended they use a smaller-size image,...
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?
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
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...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.