+ Reply to Thread
Results 1 to 4 of 4

Form writing blanks!

  1. #1
    Form problem!
    Guest

    Form writing blanks!

    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!

  2. #2
    Himszy
    Guest

    Re: Form writing blanks!

    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

    "Form problem!" <[email protected]> wrote in message
    news:[email protected]...
    > 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!




  3. #3
    Guest

    Re: Form writing blanks!

    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



  4. #4
    Himszy
    Guest

    Re: Form writing blanks!


    <[email protected]> wrote in message
    news:[email protected]...
    > 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 :-)



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1