Results 1 to 6 of 6

Thread: code question

  1. #1
    Join Date
    Jun 2002
    Posts
    173

    Unanswered: code question

    Me![payname] = Forms![frmClaim]![Combo178].Column(1)
    Me![payaddress1] = Forms![frmClaim]![Combo178].Column(3)
    'Me![payaddress2] = Forms![frmClaim]![Combo178].Column(4)
    Me![paycity] = Forms![frmClaim]![Combo178].Column(5)
    Me![paystate] = Forms![frmClaim]![Combo178].Column(6)
    Me![payzip] = Forms![frmClaim]![Combo178].Column(7)
    Me![paycode] = Forms![frm]![Combo178].Column(0)

    I have the above code set on the on-click event of a button. It pulls data from one form and puts it on the current form. It works fine, but if one of the fields are empty on the form it's pulling the data from it stops. Is there a way to ignore the null form entries if they exist?

  2. #2
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    try

    if Forms![frmClaim]![Combo178].Column(1) <>null then
    Me![payname] = Forms![frmClaim]![Combo178].Column(1)
    end if
    ...
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  3. #3
    Join Date
    Jun 2002
    Posts
    173
    I gave it a try and it gets around the null values, but now it won't input the values that aren't null. Weird.

  4. #4
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    try this instead instead then

    if isnull(Form_frmClaim.Combo178.value) then
    Me.payname = Form_frmClaim.Combo178.value
    end if
    ...
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  5. #5
    Join Date
    Jun 2002
    Posts
    173
    I tried that. No errors, but no results on anything, whether it's null or filled.

  6. #6
    Join Date
    Jun 2002
    Posts
    173
    Sorry,,,I think it is working now. thanks.

Posting Permissions

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