Please Help A newbie With An Access Database

Results 1 to 3 of 3

Thread: Please Help A newbie With An Access Database

  1. #1
    Join Date
    Dec 1969
    Posts
    213

    Default Please Help A newbie With An Access Database

    I built a submission form using a MS Access Database,<BR>it works fine. But I would like to be able to leave the fax number blank.<BR><BR>How would I change it so it can be a Zero Length String.<BR><BR>cm.CommandText ="INSERT INTO Address(name,Address,City,State,Zip,Phone,Email,Fa x) <BR>VALUES(&#039" & strName & "&#039,&#039" & strAddress & "&#039,&#039" & strCity & "&#039,&#039" & strState & "&#039,&#039" & strZip & "&#039,&#039" & strPhone & "&#039,&#039" & strFax & "&#039,&#039" & strEmail & "&#039)"<BR><BR>Thanks in advanced.

  2. #2
    William Prugh Guest

    Default RE: Please Help A newbie With An Access Database

    First of all, be careful with your order. The insert into order should match the values order. (you have fax# and e-mail reversed.) Then, write an IF just after you collect your variables values. This IF should say.....If strfax = "" then strfax = "none" End If. This will store "none" in the DB if the field was left blank.

  3. #3
    Join Date
    Dec 1969
    Posts
    2,493

    Default RE: Please Help A newbie With An Access Database

    Just set the Allow Zero Length property of the fax field in your database to yes then you don&#039t need to alter your code

Posting Permissions

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