Hello,
I wanted to get a second opinion on hardcoding on forms.
On a biweekly basis, I regularly input data into my DB. All fields have the same info, except for a few. For the fields that share info, I hardcode in VBA as following:
I typically copy and paste info from a website. Then I use the following code to automatically pull the data I want.
.txtDate = Mid(.txtInfo, InStr(.txtInfo, ";") - 10, 10)
.txtCity = Left(.txtCity, (InStr(.txtCity, ",") - 1))
I also use this code to input set data as soon as I click on btnAutoFillJPN
Me.txtActivity.Value = "New"
Me.txtCountry.Value = "Japan"
etc.
etc.
I also have this:
If Me.txtCity.Value = "Cinncinnati" then Me.txtCity.Value = "CIN"
As a rough estimate, I would say I have about 60 lines of code more or less set up like:
Me.txtFieldName.Value = "xxx"
and
IF Me.txtFieldName.Value = "ccc" then Me.txtFieldName.Value = "bbb"
I want to know if this is okay. I litterally only use this form to input data on a biweekly basis. No one else uses it. And I have it set very particular to automate EVERYTHING that I will do. I am concerned that there may be some unforeseen consequences such as:
1. The code on this form would somehow damage the code on all my other forms
2. My VBA for the whole DB becomes corrupted