DB/Reporting :: EndCurrentEdit: Form Is Erasing Data When Calling?
Aug 27, 2008
this is probably a stupid question, or im missing something. I have a customer info form, bound. I load with the following:
--------------------------
FillCombos() 'fills combo boxes
Me.DsCustomerDetail1.Customer.Clear()
Me.BindingContext(Me.DsCustomerDetail1.Customer).AddNew()
[Code].....
View 2 Replies
ADVERTISEMENT
Apr 16, 2011
I am having a dataview based on a datatable. when i am trying to insert the values into database table, i get an "Incorrect Syntax Error Near =". What could be the reason? Since this error is an sql based error, should i look for the root of this issue in Data Access Layer only or elsewhere?
View 2 Replies
Feb 5, 2012
This saves but first erases the old text.my code is like this[code]...
View 2 Replies
Jun 7, 2010
I have a MDI app that I am creating. It, of course, will have multiple MDI child forms. In each child form, I have an options button so that each child form can have it's own set of options. When I click the options button it opens an Options form. This options form is not an MDIChild.
I have a class that contains the child forms options. I pass this class to the options form using a constructor. This is how I call the options form:
Dim dlgPatternOptions As dlgOptions = New dlgOptions(thisPatternOptions)
thisPatternOptions is the class that I am passing to the Options Form.
This works fine and the options form does populate the options correctly. The Options form constructor is this:
Public Sub New(ByRef thePatternOptions As CanvasOptions)
Me.InitializeComponent()
Me.txtCanvasWidth.Text = thePatternOptions.CanvasWidth.ToString
Me.txtCanvasHeight.Text = thePatternOptions.CanvasWidth.ToString
End Sub
I change the options in the options form. How can I get those changes back to the calling form? Do I need to somehow pass a handle of the calling form to the constructor to get the changed values back to the calling form? Is there some way to pass a handle to the options form so that changes made to options will be pushed back to the calling form?
View 2 Replies
May 7, 2012
Can a data grid in another open form be refreshed by calling a sub routine? This app has a form with 2 data grids. When the user double click on one of the grids another form is opened that shows data details. After the user changes the details the user clicks a save button. We have placed this code in the Closing event of the the details form.
Private Sub FormParents_FormClosing(sender As System.Object, e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
FormParentsAndStudents.RefreshDataGrids()
End Sub
[Code]...
Can you tell us what additional coding is needed to refresh this data or if we are using the incorrect place to call this code from within the details form?
View 1 Replies
Jun 2, 2009
I'm working on a program in which users will fill out a form, and the information from the form will
be stored in a database. My problem is that I have been unable to insert the data from the form into
my table.
The variables are declared as follows:[code...]
View 1 Replies
Apr 27, 2011
Im have one heard time trying to get data back from a SP on my SQL server.Here is what I have from looking all over the net to get it working.
Dim conn = New SqlConnection("Data Source=SQLsvr5;Initial Catalog=Orders;Persist Security Info=True;User ID=userx;Password=123123")
conn.Open()
Dim sqlcomm As New SqlCommand
sqlcomm.Connection = conn
[Code]...
View 1 Replies
Apr 28, 2010
I have an application with a "filtered" DataView. The Dataview is bound to a form through a CurrencyManager. The problem is that when I add a new record using CurrMgr.AddNew(), and then use the CurrMgr.EndCurrentEdit() before saving the new record, the currency manager will point inmediatelly to the last record. How can I ensure the currency manager stays in the new record?.[code]
View 4 Replies
Mar 10, 2009
I have created a search form based on my SQL database to search for individual records based on 3 types of criteria. The form is up and running but I want to be able to add some more code. I have assigned Stored Procedure to each click event for each button. What I wantr to be able to do is after value is added to text box and button is clicked if there are no reults to display than a message box is displayed with adequate message detailing this. Also is it possible to add a count of records to the form. Once value has been enetered ij tyext box and stored procedure runs and fills dataset with required data can I display a box to show number of records from this search.
[Code]...
View 1 Replies
Jul 1, 2009
I often use a for/next loop to cycle through a collection to find a particular member of that collection based on some criteria. This works fine in every case except one: when I want to then erase the very member of the collection I just found. For example, if I wanted to give the heave-ho to every obect in a collection class that has a member veriable Color equal to Red:
[Code]...
The problem is once the collection class member is erased it makes to loop invalid because taking out the member reduces the total count of the collection in the middle of the loop. Eventually I get a "Index is out of range" error.This circumstance has bothered me every so often; I bet more experienced programmers have a different type of loop system that works better than this when you want to erase a collection member.
View 2 Replies
Apr 2, 2009
This one is killing me. I don't think this would be so difficult if M$ documentation was to the point and talked in normal speak (I guess they don't understand KISS).it seems unnecessarily difficult to raise a paint event without a picturebox getting redrawn (all existing graphics erased). Invalidate, Refresh and Update all erase the picturebox. All I want to do is get the procedure ( with Handles Picturebox1.paint) to fire so I can draw to it without erasing what is already there. I looked into the RaiseEvent statement but there are a zillion errors that pop up for one reason or another telling me I can't do it. So: 1. How the heck can I get this to work? 2. Does anyone know of a great book on vb.NET that doesn't try to impress anyone with it's command of the English language, but instead teaches. As far as I can tell, M$ is full of themselves in a major way?
View 5 Replies
Apr 28, 2011
how do i add text to a multiline textbox without erasing what is already in there?
Lets say the textbox already has...
"Visual basic is "
and then i want to add the word "fun" to the textbox without erasing "Visual basic is "
after adding "fun" i want it to read.... "Visual basic is fun"
View 6 Replies
Jan 7, 2009
I'm having a problem with the graphics portion of vb.net. As a school assignment, we are making "turtle graphics" applications. I have mine working perfectly, the problem that we are having (not even the teacher can fix it) is that when the window gets sent the command to be painted (ie minimized and maximized) the drawings in the picturebox I am using are completely erased. I am looking for a way to prevent this from happening. I have been trying to store the image as a bitmap in memory, which does not work. Is there another way to draw to a bitmap/image in memory and then output that to a picturebox?
View 2 Replies
Aug 7, 2009
I'm having an interesting issue that I can't reproduce on a different project, but can consistently on this one. I have no clue what might be causing it, but am hoping that someone may have seen it before.
I have a main form, from which I run a series of checks. On this form, I have a listview control. Because of some issues with the refreshing of this listview control, I had to create my own messagebox. It's just a form that displays some text ( it also happens to look nicer than MsgBox; in my opinion, anyways ). It's been working great for months, until recently.
My problem is that on my main form's load event, I run this check, which returns an error within a try/catch block. I then call my custom messagebox with a message. It in turns calls it's ShowDialog() function.
In any other situation ( after the main form has been loaded ), I have no problems. The messagebox goes on the screen and behaves appropriately ( ie: waits for my input and acts as a modal dialog ( stops execution of my main form's thread ) ). However, on this onload event, my messagebox comes up and goes away almost immediately afterwards.
I've traced it all the way to the showdialog() call. For no explicable reason, it appears to skip right over this call, without me doing anything on the form.
Here's what the inner trace looks like ( when I put a breakpoint on the onclosing event for this messagebox form ):
CODE:
View 10 Replies
Sep 6, 2010
Requested were made by Businese Analyst to set the few Main FORMs VISIBLE PROPERTY TO FALSE when the POPUP FORM is loaded.
[Code].....
When the MAIN FORM loads the POPUP FORM, on the FRMPOPUPCUSTOMER-FORMLOAD even, it has to set the MAIN FORM Visible to False.
When FRMPOPUPCUSTOMER FORM IS UNLOAD it has to set the MAIN FORM Visible = TRUE.
How to the coding is to ensure that different MAIN FORM when loaded FRMPOPUPCUSTOMER it will turn the MAIN FORM Visible to FALSE.
View 2 Replies
Jul 22, 2009
how to call a function from a different form. Like the button click event. i have this scenario. I have a main form and a child form in the main form there is a navigation panel on the left side controlling the child form. What i want is if clicking the add record in my navigation panel will call a function in the child form to execute.
View 1 Replies
Sep 28, 2009
I would like to know the best, or standard, way to accomplish real-time client updates in a small multi-user application using an access data table as a data source.Specifically, this application will be used by 3-4 people. It uses a datatable which is filled on form load and bound to a datagrid at design time. The datatable is stored on a shared drive. The data table on the shared drive is updated in two ways:
1) Users can update the datagrid which then updates the datatable on the shared drive via the data adapter's Update method.
2) A server application does some work on some text files, periodically updating the data table.
I need the clients to reflect the changes to the data table on the shared drive as closely to real-time as possible. I know that the data table stored in memory on the client is disconnected from the data table on the shared drive, so I must query again to get the updates.
1) Is there an alternvative model I can use which is connected, and which will automatically reflect the updates in the data table on the shared drive?
2) If not, what is the best way to check for changes in the data table (so I can know when to call the data adapter fill method)? I am planning to poll the drive for a change to the .mdb file, raise an event and then fill the data adapter when the event is triggered. I am using this method successfully now to check for changes to a text file in another application, and I know how to implement it?
View 1 Replies
Sep 27, 2009
I recently switched to V.Studio 2008 and using VB. I can not find in the data toolbox the connection and data adapters. Should I do something else to make this appear so I can drag them in my form.
View 2 Replies
Mar 26, 2008
I am using VB2008 Express and a MSSQL Server 2005 db by the way! I have a comprehensive SQL statement, which should fill my Grid:
DECLARE @Sum NUMERIC(9,2)
SELECT @Sum = SUM(I_LS.lmenge)
FROM dbo.lfs AS I_L
[CODE]...
Now here is my problem! I want to have a form with a datagridview that displays all of the values I am querying. This shouldn't be a problem I guess. However, I have no idea how I can integrate two textboxes that can be used to enter the selection criteria (WHERE I_L.lfsnr LIKE '%1253') AND (l.sped_journal = '11-08')[/SIZE]. I have googled and read many threads so far but didn't stumble upon anything that would suit my needs and answer my question. Maybe it's just too elementary!? By the way, it is very important that the input of textbox1 ((WHERE I_L.lfsnr LIKE '%1253')) is linked to 3 positions in my SQL query to define the search criteria!
The worst thing is that I don't want to have a bindingnav displayed! I do not need any delete, update or add functions just the select option, however!
View 1 Replies
May 31, 2008
I have a parent form that has a combobox. Whn the form loads I get the data from the db and bind to the combobox. that works fine and here is the code I use in form load to cause this to happen: [code] Now if there is not an Account Type, I have a button that will pull up a small form to allow the addition of an account type. The popup form adds the data back to the database just fine, but I am now trying to get the combobox to refresh its data. So I call a public Sub that is located in the parent form to from the popup form to accomplish this task and I have walked the code and the sub is called and appears to work correctly, but the new data never appears in the combobox. Here is my public sub that i call to try and refresh the combobox on the parent form. [code] But when I go back to the parent form, the combobox is not updated with the new account. How can i get the combobox to refresh from the database with the new data?
View 4 Replies
Feb 8, 2009
I am currently using vb 2008 and access 2003 as back end database. I am trying to import excel data to a data table. my excel and access table header & columns are same. I was trying to do this.........
[Code]...
View 1 Replies
Sep 29, 2008
I tried this code to check if the data in textbox1 not equal to any data in column name, so insert the data that in the textboxes to the table1. Esle.. do another thing. But it didn't success with me.
Code:
Dim conn As New OleDbConnection()
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source =" & Application.StartupPath & "DataBaseName.mdb "
[Code].....
View 2 Replies
Sep 21, 2010
I have two forms and one needs to call a method from another form. I am from a java background so i do not understand why the object instaniated (if that is a correct assessment) on one form cannot Call a sub from the second form.
View 1 Replies
Mar 2, 2009
i used the code below to find if any forms called logform are open, there will only ever be one of these open at a time...
Code:
Dim frm As Form
For Each frm In My.Application.OpenForms
If frm.Name = "logform" Then
MsgBox("found form")
[code].....
but thing is when i find the form i want to call a sub in that form's code called action if i use frm.actions() it says that actions() is not a member of [URL]so how do i do this?
View 14 Replies
Dec 13, 2009
I am just wondering the difference between using "As New" and not using it. It looks like the outcome is same to me. Is there any difference between #1 and #2 when I call "frmCR" from other winform?
A form "frmCR" is alreadu created thru design mode.
#1
Dim frmCR As New frmCR
frmCR.Show()
#2
frmCR.Show()
View 7 Replies
Mar 26, 2011
I'm trying to call a C++ DLL from inside VB.NET and am having difficulty with the data types (I think), I understand VB.NET far more than I do C++...I think my main problem is differing data types and I don't understand enough C++?In C++ the DLL is called (I don't have the source for the DLL which would solve my problem, I only have a sample project written in C++) by this;
_InitSensor = (InitSensor)GetProcAddress(m_hInstLibrary, "InitSensor");
_FreeSensor = (FreeSensor)GetProcAddress(m_hInstLibrary, "FreeSensor");
_ReadTEMPsh10 = (ReadTEMPsh10)GetProcAddress(m_hInstLibrary, "ReadTEMPsh10");
_ReadType=(ReadType)GetProcAddress(m_hInstLibrary,"ReadType");
(Variables Declared Previously in other file like this;)
typedef char* (*InitSensor)(char ICType);
typedef void (*FreeSensor)();
typedef double* (*ReadTEMPsh10)(BYTE n);
typedef double (*ReadType)(BYTE address);
View 3 Replies
Mar 11, 2010
I have login form as start up form and i call Form1 after successful validation and in Form1, i have close button on click of Close i would like to reset username and password fields on loginform to null. If i add code in form1 below i get exception Dim fmLogin As New LogInForm
An unhandled exception of type 'System.StackOverflowException' occurred in System.Windows.Forms.dll
Make sure you do not have an infinite loop or infinite recursion
I get above on LoginForm below statement Dim fmMain As New Form1
How to take care of this problem
View 1 Replies
Feb 18, 2011
I have to generate an XML file from several database tables. I could use the WriteXml method of the DataSet to do it, but the database tables are really huge and I can't add all those tables in the DataSet at the same time or it may cause a problem because of the big amount of memory used. Then I decided to use the DataTable's WriteXml method and save table after table, but the the generated file only stores the information of the last DataTable.WriteXml's call. How can I preserve the previous XML data when adding all that information?
View 4 Replies
Sep 2, 2011
Is it advisable to call a function from another form?Does it have any side effects on the system while running, like more process will consume?I have a function that will set the background in a form, it will make the image stretch, backcolor transparent and will set the picture. If I will use that function in other 15 FORMS I can minimize my code.
View 9 Replies
Jun 26, 2011
Version: visual basics 2008
Problem:
Form 1 contains a SWF object, which is called FlashGame (it has a movie set, which is a game)
Form 2 contains a button to set a variable on the FLashGame.
Example
Call FlashGame.SetVariable("variable will be here", 1)
That simple coding works when the button to call that SetVariable command is on the same form as the FlashGame, but I need them to be on different forms.
View 1 Replies