Results 1 to 4 of 4
  1. #1
    campbell707 is offline Novice
    Windows 8 Access 2007
    Join Date
    Dec 2015
    Posts
    10

    how to code specifically for a cell in a table

    Hi,



    I am looking to create a box on a form that will change color based on whether or not a cell has been filled on the table. I am using this as a visual validation on the form so people can tell whether they have entered the data without going to the table.

    I was thinking of using IF then else statement but I am not quite sure how to call the cell on the table.

    Thinking like...

    Private Sub Form_Current()

    If IsNull(ActiveSheet.Range("F1").Value) = True Then
    Textbox1.BackColor = vbWhite
    Else
    Textbox1.BackColor = vbRed
    End If

    End Sub


    But it seems to cause a bug when viewing the form. Any thoughts?

    Thanks!

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    It sounds like these are Excel questions. This is an Access forum.

    Access does not have "cells". A datasheet looks like a spreadsheet, but Access and Excel are two totally different animals.

    Care to elaborate more about your question?

  3. #3
    campbell707 is offline Novice
    Windows 8 Access 2007
    Join Date
    Dec 2015
    Posts
    10
    Thanks for responding!

    I am trying to come up with a way for a person to see if there are still cells in a table that are empty but from a form page. I have 4 fields for them to enter a value for but 17 rows to fill. I have a listbox on the form so they can go from row entry to another but its all in the same form. I am hoping there is a way I could code a box to highlight a different color based on whether there is still cells that are empty.

    Thanks

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I would use conditional formatting. No code necessary.

    You would have to apply conditional formatting to each of the 4 controls for which you want the color to change.


    -------------------------------------
    Tables have fields.
    Forms have controls.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Dlookup() With Multiple Criteria (Specifically: a String, & Two dates)
    By QA_Compliance_Advisor in forum Programming
    Replies: 19
    Last Post: 07-09-2015, 05:26 PM
  2. Replies: 1
    Last Post: 03-11-2014, 11:30 AM
  3. Replies: 1
    Last Post: 03-07-2014, 11:37 AM
  4. Replies: 1
    Last Post: 07-12-2013, 01:48 PM
  5. Can we post Access cell data to Excel cell properties?
    By Zethro in forum Import/Export Data
    Replies: 1
    Last Post: 12-13-2005, 08:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums