I have been very silly....was trying to update TextBox2 with TextBox1 data from btnSave click event and not the SaveChanges()therefore the data was being scrubbed! thansk for your help and sorry for wasting your time!
i am trying to update textbox2 with the last record entered into textbox1, having just saved the record to a table! In Access this was fairly easy:
Control Source = Last("textbox1")
Is there an easy way to do this in VB.net??
Does anyone have any quick code which will set combobox list items (3 items) to different colors. I want to set the following: index 0 = white, index 1 = yellow and index 2 = pink. I'm sure this is fairly simple just can't suss it out....
Aha...regex does the trick..thanks for your help earthandfire. Here's the code:
Dim myRegExp As System.Text.RegularExpressions.Regex
If myRegExp.IsMatch(txtFileName.Text, "[0-9][0-9][0-9][0-9][0-9][0-9][1-2 or A-Z]") = True Then
' ok!
MsgBox("Number Accepted")...
Hi TopGiver
can you help with some if..else nested syntax? If the first txtFileName.Text expression is true I want to evaluate if the txtFileName.Text number has a '1' or a '2' as the 7th digit. If the number is a '2' I want to set cboEyes.SelectedIndex = 1 else leave it as it is...problem is...
Hi Mansii
Just the ticket. Does exactly what I need it to do and very simple. I had seen references to the ExecuteScalar method previously but wasn't sure how to use it. Thanks again!
I am having problems writing some user login DataReader code. I'm not entirely sure how the DataReader object works and have come a cropper when trying to authenticate the txtPassword data. Do I need to initialise 2 select queries (1) username (initials)(2) password (Login_ID), can i use a...
Thanks Top-Giver...I was heading in the right direction, but this bit of code works perfectly:
'Dim myRegExp As System.Text.RegularExpressions.Regex
'If myRegExp.IsMatch(txtFileName.Text, "[0-9][0-9][0-9][0-9][0-9][A-Z]") = True Then
' ' ok!
'...
how do i limit entry into a textbox to either a 7 digit number or 6 digit alphanumeric string? I have tried the following code but no luck, is it a syntax error? can anyone help?
If Not (txtFileName.Text = "[0-9],[0-9],[0-9],[0-9],[0-9],[0-9],[0-9]" Or txtFileName.Text =...
I am trying to recreate some DLookup code in .net.....but having some difficulties. All I want to do is lookup existing table data so as to validate against user textbox duplicates....if there is a duplicate record then provide an error message, followed by inserting the duplicate into an...
Sorry my description was a bit vague and you are right...I would like to reset all the controls so that the user can make selections again, click save and then do the same process again etc.. I am sure that this was relatively easy in Access with the following code e.g. Me!cboF2TotalHE = ""...
Me again
Once the user has clicked the save button I am trying to refresh the forms combobox controls (so that the text property is displayed again), however I can't seem to find the correct code to do this... the only success I have had is by using the cboF2TotalHE.SelectedIndex = -1 code, but...
aha..you are a genius. It works! how silly of me to be messing around with boolean logic. 1 question, I tried to change the cboF2TotalHE_SelectedIndexChanged event so that it could update all the other cbo's on the form (1) by hardwiring all the cbo's in as below commented code (which works...
ok this seems like a more elegant way to approach this.. I have added a cbo as follows:
Private Sub cboF2TotalHE_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles cboF2TotalHE.Validating
If (cboF2TotalHE.SelectedIndex = -1) Then...
Hi TopGiver
I have another problem which is related to the above but is down to my lack of clear understanding of boolean logic and whether to use an if....else statement, a case statement or a combination of them both. The conditional statement below fails and I am getting muddled with the...
Thanks TopGiver for the 3 fine examples. They all worked. I have gone with ErrorProvider example for now, and added focus(), undo() and clear(). Here's the code:
If Not (txtF2Total.Text = "0" Or txtF2Total.Text = "2" Or txtF2Total.Text = "9") Then...
Problem solved. I set the default value for the radio buttons and checkboxes at loadtime. As follows:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
dsLogging.PinkGradingLoggingData.Columns.Item("EyeRight").DefaultValue() =...
Private Sub txtF2Total_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtF2Total.Validating
I wish to validate a textbox (txtF2Total) to accept just 3 possible values: "0", "2" and "9". This was simple in Access however i am struggling. Can anybody...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.