Results 1 to 8 of 8
  1. #1
    epardo87 is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Dec 2016
    Posts
    102

    Link combobox in form to a particular cell in table

    Hello all,

    So I have this form "Supervisor Desig", where I placed three times the combobox for the "supervisor" column in the table "tblArea". I know that I could just embed the table in a form or put a combobox for the "area" column as well. but I'm designing this platform to be as friendy-user as possible. so I would like that the name selected in the first combobox updates only the row corresponding to "Grupo A" and so on...

    I'd really appreciate your help, thanks!



    Click image for larger version. 

Name:	sup form.jpg 
Views:	18 
Size:	59.9 KB 
ID:	26849

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    Forms only work 2 ways:
    a single record form (shown?) that shows 3 fields
    or
    a continuous form,to show All records

    which is yours?

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Change:
    Grupo A
    combo box
    Row Source: SELECT Supervisor FROM tblAreas WHERE Area = "Grupo A"

    Grupo B combo box
    Row Source: SELECT Supervisor FROM tblAreas WHERE Area = "Grupo B"

    Grupo C combo box
    Row Source: SELECT Supervisor FROM tblAreas WHERE Area = "Grupo C"


    If there are many people on Grupo A they will show up only in the one combo box.

  4. #4
    epardo87 is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Dec 2016
    Posts
    102
    thank you ranman256, I had seen about these two types of forms but completely forgotten about it. the continuous form is what I was looking for, now I just have one more question.
    When selecting the continuous form, I have three records, but it shows me a fourth one, the new record option, but I don't want to display that, i tried to erase it from design and layout views but wont let me, how can I avoid it from being displayed?
    Click image for larger version. 

Name:	sup form.jpg 
Views:	14 
Size:	31.0 KB 
ID:	26862

  5. #5
    epardo87 is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Dec 2016
    Posts
    102
    Quote Originally Posted by ssanfu View Post
    Change:
    Grupo A
    combo box
    Row Source: SELECT Supervisor FROM tblAreas WHERE Area = "Grupo A"

    Grupo B combo box
    Row Source: SELECT Supervisor FROM tblAreas WHERE Area = "Grupo B"

    Grupo C combo box
    Row Source: SELECT Supervisor FROM tblAreas WHERE Area = "Grupo C"


    If there are many people on Grupo A they will show up only in the one combo box.
    thanks ssanfu, actually, the column "supervisor" is pulled from a query, so im writing the code like the following, but i'm getting a Syntax error... what am I doing wrong?

    Code:
    Private Sub Combo0_Change()
    
    
    Combo0.RowSource SELECT supervisor FROM tblAreas WHERE Area = "Grupo A"
    
    
    End Sub

  6. #6
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Allow Additions - that is the form's property that you need to set to No.

  7. #7
    epardo87 is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Dec 2016
    Posts
    102
    Great! thanks aytee111

  8. #8
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Quote Originally Posted by epardo87 View Post
    thanks ssanfu, actually, the column "supervisor" is pulled from a query, so im writing the code like the following, but i'm getting a Syntax error... what am I doing wrong?
    You DON"T use the combo box change event to set the combo box row source!

    Your image in Post #1 was a form in Single Form view. Now it appears that you are using continuous form view.
    What is the SQL of the query?


    I would rename the combo box for the area "cboArea". I would set the combo box Row Source property to something like
    Code:
    SELECT DISTINCT Area FROM tblAreas ORDER BY Area
    The combo box for the supervisor I would name "cboSupervisor". I would set the combo box Row Source property to something like
    Code:
    SELECT Supervisor FROM tblAreas WHERE Area = '" & me.cboArea & "'"
    Would need to see the dB to give a better answer...........

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

Similar Threads

  1. Replies: 1
    Last Post: 07-12-2013, 01:48 PM
  2. how to put a table cell in a access form
    By debon123 in forum Forms
    Replies: 1
    Last Post: 05-05-2012, 10:55 AM
  3. cell from table to unrelated form
    By Justin Warner in forum Forms
    Replies: 3
    Last Post: 01-01-2012, 08:06 PM
  4. Replies: 1
    Last Post: 09-11-2011, 06:14 PM
  5. Link ComboBox to field in a table
    By DrDebate in forum Forms
    Replies: 0
    Last Post: 04-27-2007, 08:03 AM

Tags for this Thread

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