If I create a database that has 3 fileds per record; String1, String2 & ResultString. I want the user to enter in the first 2 strings then the program creates ‘ResultString’ by adding the String2 to String 1 itself.
Ie if you enter Big as String1 and Cat as String2 I want ResultString to be BigCat.
I guess I create a sub that is triggered by a change in either 1 of the 2 user entered fields then execute some code as below:
hi. i think it is much better that you will use the values of the string1 and string2 for the value of Data1.Recordset.Fileds(“ResultString”). You have not yet save any the data so your values for Data1.Recordset.Fileds(“String1”) and Data1.Recordset.Fileds(“String2”) are both null.
There's another problem you can run into that will give a Null error. If one field is empty there is nothing to concatenate. So how do you check for that? If you read the textbox into a text variable and check for Null, it will never be Null because it is a string type. IsNull only works with variants, I think. So assign the .text from the textbox to a variant and use IsNull. If the .text is not Null, you can use it as-is, or re-assign it to a string variable. If it IsNull, replace it with "" and go on.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline:String Handling