First of all, you are using a datacontrol to handle all your data requirements. I personally would have used ADO etc, where you can specify
App.Path
.
Currently you have your database in your F: drive. Make sure that when you are running your app, the database is in the same drive on the host pc, otherwise you will get errors of not finding/connecting to the database.
Secondly, when adding new data, i.e. a new user, you have the following code -
!Address = Int(txtAddress.Text)
. This will raise an error if a user enter text and not an integer or numbers, as is what happened to me. Build error traps into your application... You will use something like -
If Not IsNumeric(txtAddress.Text) Then
SendKeys "{BackSpace}"
End If
'Use this in the txtAddress_Change sub
Thirdly, when you view your clients from your datagrid and you select to add a new client, AFTER saving the record, refresh your datagrid so that the new client can be viewed -
datClients.Refresh
'You should refrain from using dat as a prelude to a datagrid name. Rather call it grdClients. datClients would normally refer to a datacontrol.
Fourthly, we do not use Gloabal anymore. Use Public instead. You are also refrencing a textbox in your module -
If (txtMovieID.Text = "") Or (txtMovie_Name.Text = "") Or (txtGenre.Text = "") Or (txtType.Text = "") Or (txtMovie_Year.Text = "") Or (txtCopies.Text = "") Or (txtRating.Text = "") Then
flag = 1
Else
flag = 0
End If
, but nowhere on which form it is placed. Again, personally, I would rather use the variables on a form level, and not in a module. Else try to add the following -
If (frmClientRecords.txtMovieID.Text = "") Or (frmClientRecords.txtMovie_Name.Text = "") Or (frmClientRecords.txtGenre.Text = "") Or (frmClientRecords.txtType.Text = "") Or (frmClientRecords.txtMovie_Year.Text = "") Or (frmClientRecords.txtCopies.Text = "") Or (frmClientRecords.txtRating.Text = "") Then
flag = 1
Else
flag = 0
End If
This is how far I got testing your app. First try and correct these problems before we continue. REMEMBER, add error trapping to your application. Do not wait for it to generate the error first and crash. Run your app constantly to test all the code you have added.
Good luck. If you find more errors, let us know where the error occurred, and we can help you so much quicker.:)