473,796 Members | 2,619 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to refresh the form

(Type your message here)

--------------------------------
From: venkat g

as soon as i click save button in should save the data and form must be refresh
ihave written as
me.refresh

my coding is as follows

If (txtget.Text = "Add") Then
ObjCon.Open()
objAdapt = New OleDbDataAdapte r("select * from DB_KEYINFO", ObjCon)
objAdapt.Fill(d s)
ObjDtview = ds.Tables(0).De faultView
ObjDtview.RowFi lter = " [Keyno] = '" & CInt(txtKeyno.T ext) & " '"
If (ObjDtview.Coun t > 0) Then
MsgBox("The Record Is Alreday Exists")
Me.Refresh()
ObjCon.Close()
Else
'ObjCon.Open()
ObjCmd.Connecti on = ObjCon
ObjCmd.CommandT ype = CommandType.Tex t
ObjCmd.CommandT ext = "Insert into DB_KEYINFO Values( '" & txtname.Text & "'," & txtpsno.Text & ",'" & txtdepartment.T ext & "','" & cmbfloor.Select edItem.text & "'," & txtKeyno.Text & ")"
ObjCmd.ExecuteN onQuery()
MsgBox("Records Saved successfully")
ObjCon.Close()
End If

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>42jOgrcuxE6 pG3AVbxg2RA==</Id>
Nov 21 '05 #1
3 12242
what control needs to refresh? have you already bound it to the
datasource?

Nov 21 '05 #2
Venkat,

Your code is not changing anything on screen when you to the inster.
Therefore: "Why should it refresh after that you updated it?

In addition, why are you using consequently obj before every object. It adds
in my opinion nothing to your code, it makes it only less readable.

Cor
Nov 21 '05 #3
Do you by any chance mean that you want to clear the form? If so, you will
need to empty each of the text boxes you have in the form.

--
Rgds,
Anand
VB.NET MVP
http://www.dotnetindia.com
"venkat g via .NET 247" wrote:
(Type your message here)

--------------------------------
From: venkat g

as soon as i click save button in should save the data and form must be refresh
ihave written as
me.refresh

my coding is as follows

If (txtget.Text = "Add") Then
ObjCon.Open()
objAdapt = New OleDbDataAdapte r("select * from DB_KEYINFO", ObjCon)
objAdapt.Fill(d s)
ObjDtview = ds.Tables(0).De faultView
ObjDtview.RowFi lter = " [Keyno] = '" & CInt(txtKeyno.T ext) & " '"
If (ObjDtview.Coun t > 0) Then
MsgBox("The Record Is Alreday Exists")
Me.Refresh()
ObjCon.Close()
Else
'ObjCon.Open()
ObjCmd.Connecti on = ObjCon
ObjCmd.CommandT ype = CommandType.Tex t
ObjCmd.CommandT ext = "Insert into DB_KEYINFO Values( '" & txtname.Text & "'," & txtpsno.Text & ",'" & txtdepartment.T ext & "','" & cmbfloor.Select edItem.text & "'," & txtKeyno.Text & ")"
ObjCmd.ExecuteN onQuery()
MsgBox("Records Saved successfully")
ObjCon.Close()
End If

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>42jOgrcuxE6 pG3AVbxg2RA==</Id>

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2719
by: Akinia | last post by:
Hi every body I've got a little problem with my form ("frm_Company"). It is divided in two parts: - first one is filled with some text fields over the company. - second one is filled with a tab control and give informations about contact persons. On this tab control there is also a form ("frm_ContactPerson") which contains some text fields linked to a subform. The subform displays in a datasheet few informations about the contact
1
1951
by: Bill | last post by:
I have five users using the same forms to enter and retrieve data from an Access database held on a server but the only way each user can see any changes to records is by closing and reopening the database Ive created a refresh button on each form to refresh the data but still no luck, I think it failed because it's over a network but not sure - can somebody provide me with the code that I add to the refresh button. Thanks, Bill
1
2931
by: jdph40 | last post by:
I have a form (frmEmpMaint)that can be opened from the switchboard and/or from a button on another form (frmVacations). frmVacations is based on a query where the criteria for employment status is "A" (active). When frmEmpMaint is opened from frmVacations and the employee's status is changed to "T" (terminated), and frmEmpMaint is closed, that employee still shows up on frmVacations, with his new status of "T". How do I get frmVacations...
3
7858
by: Brian Basquille | last post by:
Hey there all, Fairly easy question for a C# expert, i assume! Am still working on my Photo Album. On frmBrowsePhotos, i have a listBox (photosList) containing photoID's from a table in an Access Database. I click 'Add Photo' on that form and after the OpenFileDialog (etc.), it asks me to save some information about the photo (caption etc.) on a new form (frmAddPhotoInfo) opened up in front of the previous (frmBrowsePhotos).
3
6198
by: KayC | last post by:
Hi Background info: I am running Access 2000 I have a form bound to a blank table When a user clicks a button the form opens in datasheet view User enters data into form and closes form User clicks button which then creates an inner join between form bound table and master table and updates records in master table where values are equal to form bound table
0
1852
by: M G Henry | last post by:
I am using Access 2003 and have a form with two subforms on them. I would like to be able to use a command button to add the row of data ( 5 fields ) that are completed on the subform, as well as refresh the parent form which has a list box that shows the values from the first field ( custname ) that have been added thus far to the table linked to the subform. My form has two subforms and I would like the command buttons to work...
5
2996
by: Umoja | last post by:
Hi Guys, I need for one of my form to refresh after a selection is made from a combo box. On my main table I have a status field which the default value is set to ‘No’. Once the selection is made from the combo box the status of the account is changed to ‘Y’. I have an update query which updates the status once the selection is made. The main source for the form is a query, in the query I have the criteria to only display ‘No’ for the...
4
6302
by: billa856 | last post by:
Hi, My project is in MS Access. In that I have one Form(DataEntry) which I am using for entering data into the Table(PRODUCTION). Now after entering data in Textboxes when I click on Button(Submit) then it add data to my table. Now I want that, When I click on Submit Button at that time first it add data to table and after that refresh the Form also at the same time.So I can add new data. I know this is possible but I don't know how to do...
7
10527
by: CF FAN | last post by:
need logic so when the page is refreshed that it returns to the location of the change, not to the top of the page. Currently, when the page is refreshed, it takes you back to the beginning of thepage, not the area you may be working on. What we need the page to do is when enter or tab is pressed and the page refreshes, take you back to the exact spot on the page you were at when you pressed enter.when each refresh form submition take...
11
6500
by: rajeevs | last post by:
Hi All I have two issues to put forward. First is bookmarking / or highlighting a particular record in a form. The form is continuous and the records are from a query result. One of the record in that form will be always the last added record from the table. The form display the records in a sort order from the query. What i need is to highlight or bookmark a particular field of that record (the last record added) whatever the position of...
0
9685
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
10239
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...
1
10190
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10019
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...
0
9057
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7555
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
5447
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
3736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
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.