473,320 Members | 1,863 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,320 software developers and data experts.

3 forms

I have a project to submit in a few hours' time. In order to explain what I need clearly, I will provide a very simple example. Suppose I have an application consisting of 3 forms-
The first has a textbox(txtName) and a button leading to the second form.
The second has another textbox(txtFamilyName) and a button both leading to the third form and sending the info to a row in MS Access.
The third only has a button coming back to form1 so that a new row can now be added to the Access file.My Q is:
1) In which form(s) do I need to establish the connection between my application and the MS Access file?
2)What is the coding for the buttons in form 2 and 3?

Your input is greatly appreciated...
Dec 8 '07 #1
3 1396
Oh..n just for clarification, by the info, I meant the text in txtName and that in txtFamilyName!!
Dec 8 '07 #2
kenobewan
4,871 Expert 4TB
Homework Assignment

The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don't know how to achieve. This question will now be closed and you will have to post a new question when you're ready.

MODERATOR
Dec 8 '07 #3
I have a project to submit in a few hours' time. In order to explain what I need clearly, I will provide a very simple example. Suppose I have an application consisting of 3 forms-
The first has a textbox(txtName) and a button leading to the second form.
The second has another textbox(txtFamilyName) and a button both leading to the third form and sending the info to a row in MS Access.
The third only has a button coming back to form1 so that a new row can now be added to the Access file.

My own project, ofcourse, is much more complicated than this, but I am hoping this would keep things simple and clear...

Let's assume that I've established a connection between my application and the access file in all three forms... which is exactly what I have done in my own 7 form application (lol!). then in the loading event of form 1 I have typed the following code:

Dim pintrecords As Integer
Dim bndTemp As Binding

pintrecords = odbdaApplicants.Fill(DsApplicants1)

bndTemp = New Binding("text", DsApplicants1, "tblApplicants.fldName")
txtName.DataBindings.Add(bndTemp)

txtName.text=""

bndTemp = New Binding("text", DsApplicants1, "tblApplicants.fldname")
txtName.DataBindings.Add(bndTemp)

The reason why I cleared txtName.text was that it was showing info already in the access file and I wanted to enter info that would now go into a new record.

In the loading event of form 2, I have entered the same coding as above except that I've replaced txtName with txtFamilyName and fldName with fldFamilyName

In the coding for the button in form 2 I have entered the following:
Dim pdsInsertedRows As DataSet

Me.BindingContext(DsApplicants1, "tblApplicants").EndCurrentEdit()

pdsInsertedRows = DsApplicants1.GetChanges(DataRowState.Added)
If Not pdsInsertedRows Is Nothing Then
odbdaApplicants.Update(pdsInsertedRows)
End If
DsApplicants1.AcceptChanges()

Dim frmNewApplication As New Form3
Me.Hide()
frmNewApplication.Show()

In coding for the button in form3 I have entered the following:

Me.BindingContext(DsApplicants1, "tblApplicants").AddNew()

Dim frmName As New Form1
Me.Hide()
frmName.Show()

I have no problem entering the info or browsing through the forms, but once I check the access file, it hasn't been updated ( a new row hasn't been added).... Can you please tell me where I'm wrong??
Dec 8 '07 #4

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

Similar topics

19
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate...
3
by: Joshua Russell | last post by:
Hi, Both the methods below open up a windows form called MasterForm. However, one works better than the other. Method 1 opens the form correctly but I don't have any reference to the instance of...
7
by: Mike Bulava | last post by:
I have created a base form that I plan to use throughout my application let call the form form1. I have Built the project then add another form that inherits from form1, I add a few panel controls...
13
by: MD | last post by:
I have been converting a program from VB6 to VB.Net and enhancing it as well. All has been progressing OK although its been hard work. Now, all of a sudden, when I try to execute a ShowDialog()...
15
by: Joshua Kendall | last post by:
I have a script in which it keeps opening the same form instead of only one instance. I also need help with a form that has a password. Where do I put the actual password? can I use a database for...
3
by: Lloyd Sheen | last post by:
I have the following situation: Need a user resizable user control. After much trying with user control I came across the idea of hosting the controls in a form marked as not TopLevel = false. ...
8
by: Stephen Rice | last post by:
Hi, I have a periodic problem which I am having a real time trying to sort. Background: An MDI VB app with a DB on SQL 2000. I have wrapped all the DB access into an object which spawns a...
3
by: Geraldine Hobley | last post by:
Hello, In my project I am inheriting several forms. However when I inherit from a form and add additional subroutines and methods to my inherited form I get all sorts of problems. e.g. I sometimes...
6
by: dbuchanan | last post by:
I have a Windows Forms application that accesses SQL Server 2k from a small local network. The application has been used for weeks on other systmes but a new install on a new machine retruns...
21
by: Dan Tallent | last post by:
In my application I have a form (Customer) that I want to be able to open multiple copies at once. Within this form I have other forms that can be opened. Example: ZipCode. When the user enters...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.