Form writing blanks!

  • Thread starter Thread starter Form problem!
  • Start date Start date
F

Form problem!

I have a form and it keeps on overwriting values with
blanks if nothing is entered.

I would like to stop this if the textbox on the form is
blank then do not try to write anything at all whether
destination cell is blank or already has a value.

Also if there is some information already there is it
possible to get a message box for each textbox stating "A
already has a value! would you like to replace x with y?"

This would be great if I can. Anyone know how?

Thank you!
 
Why not add a If function saying that if the textbox is empty then do
nothing and if it contains something overwrite?
I would add something along the lines of
message = "A already has a value! would you like to replace " + x " with "
y "?"
then
msgbox message.

Hope this helps
Michael
 
I have been writing my code like this -

Set Rng = shData.Range("I" & Application.Match(CLng
(sh.Range("D6")), shData.Range("B:B"), 0))
Rng.Value = sh.Range("D8").Text

but now have tried it like this as you said to but it
gives me an error.

If sh.Range("D8") Is Null Then
End
Else
Set Rng = shData.Range("E" & Application.Match(CLng
(sh.Range("D6")), shData.Range("B:B"), 0))
Rng.Value = sh.Range("D8").Text
End If

What do I need to add? And how do you set up a msgbox
replace x with y.

Thanks
 
I have been writing my code like this -

Set Rng = shData.Range("I" & Application.Match(CLng
(sh.Range("D6")), shData.Range("B:B"), 0))
Rng.Value = sh.Range("D8").Text

but now have tried it like this as you said to but it
gives me an error.

If sh.Range("D8") Is Null Then
End
Else
Set Rng = shData.Range("E" & Application.Match(CLng
(sh.Range("D6")), shData.Range("B:B"), 0))
Rng.Value = sh.Range("D8").Text
End If

What do I need to add? And how do you set up a msgbox
replace x with y.

Thanks
Hi, i'm only a noob, ask one of these boffins :-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top