A
aintlifegrand79
I have created a database with two userforms the 1st userform enters the data
into the database, while the second finds data from the database based on a
project number and allows the user to edit the information that has already
been entered. The problem I am having is when I enter the data in the 1st
userform if I don't put a character in each textbox in the userform then when
I go to find the information it won't allow me to edit and save any of my
changes made to the product. Currently I am just putting a "x" into each
textbox so I can edit/save it, but with 45+ Textboxes on the userform this is
tedious. Is their anyway to make it so if nothing was entered I can still
edit/save it. Here is a portion of the code that I am currently using (the
rest of the code is same as what I have here). Thanks for your help.
Private Sub SaveProjectButton_Click()
Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 1).Value =
Replace(Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 1).Value,
Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 1).Value,
tbAEName.Value)
Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 2).Value =
Replace(Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 2).Value,
Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 2).Value,
tbSiteOwnerName.Value)
Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 3).Value =
Replace(Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 3).Value,
Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 3).Value,
tbPGLead.Value)
Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 4).Value =
Replace(Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 4).Value,
Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 4).Value,
cbProjectType)
Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 5).Value =
Replace(Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 5).Value,
Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 5).Value,
cbProjectCategory)
Sheet2.Columns(1).Find(tbProjectNumber.Value).Offset(0, 1).Value =
Replace(Sheet2.Columns(1).Find(tbProjectNumber.Value).Offset(0, 1).Value,
Sheet2.Columns(1).Find(tbProjectNumber.Value).Offset(0, 1).Value,
tbAEName.Value)
into the database, while the second finds data from the database based on a
project number and allows the user to edit the information that has already
been entered. The problem I am having is when I enter the data in the 1st
userform if I don't put a character in each textbox in the userform then when
I go to find the information it won't allow me to edit and save any of my
changes made to the product. Currently I am just putting a "x" into each
textbox so I can edit/save it, but with 45+ Textboxes on the userform this is
tedious. Is their anyway to make it so if nothing was entered I can still
edit/save it. Here is a portion of the code that I am currently using (the
rest of the code is same as what I have here). Thanks for your help.
Private Sub SaveProjectButton_Click()
Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 1).Value =
Replace(Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 1).Value,
Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 1).Value,
tbAEName.Value)
Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 2).Value =
Replace(Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 2).Value,
Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 2).Value,
tbSiteOwnerName.Value)
Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 3).Value =
Replace(Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 3).Value,
Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 3).Value,
tbPGLead.Value)
Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 4).Value =
Replace(Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 4).Value,
Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 4).Value,
cbProjectType)
Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 5).Value =
Replace(Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 5).Value,
Sheet1.Columns(1).Find(tbProjectNumber.Value).Offset(0, 5).Value,
cbProjectCategory)
Sheet2.Columns(1).Find(tbProjectNumber.Value).Offset(0, 1).Value =
Replace(Sheet2.Columns(1).Find(tbProjectNumber.Value).Offset(0, 1).Value,
Sheet2.Columns(1).Find(tbProjectNumber.Value).Offset(0, 1).Value,
tbAEName.Value)