Results 1 to 10 of 10
  1. #1
    Join Date
    Dec 2009
    Posts
    6

    Unanswered: Forms Controls bound to Expressions Can't enter data

    Hi all,
    I am working on Tables that were copied from an existing databse and relabeled to expand the program;
    For example: TableDalas was copied and relabled TableDalas_New; and FormDalas_New was also made from FormDalas.
    My problem is redirecting the properties of FormDalas_New so that any information entered will populate TableDalas_New.
    I have changed the Record Sources in the propertied of the forms but still get an error message that reads
    Control can't be edited; it's bound to the expression '[Site_list].[Column](1) each time I try to enter data in a field.

    I work mainly with the properties window but can follow basic instruction on coding. Please see codes on one Form below:
    ----------------
    Option Compare Database

    Private Sub Form_Load()

    Dim i As Integer

    For i = 0 To Me.Controls.Count - 1
    If Right(Me.Controls(i).Name, 4) = "list" Then
    Me.Controls(i).Width = 0
    Me.Controls(i).Height = 0
    Me.Controls(i).Locked = True
    ElseIf Right(Me.Controls(i).Name, 3) = "txt" Then
    Me.Controls(i).Locked = True
    End If
    Next i

    End Sub

    Private Sub Form_Close()
    Dim i As Integer

    For i = 0 To Me.Controls.Count - 1
    If Right(Me.Controls(i).Name, 4) = "list" Then
    Me.Controls(i).Width = 0.125
    Me.Controls(i).Height = 0.125
    Me.Controls(i).Locked = False
    ElseIf Right(Me.Controls(i).Name, 3) = "txt" Then
    Me.Controls(i).Locked = False
    End If
    Next i
    End Sub

    Private Sub NextPage_cmd_Click()
    Dim whereclause As String

    whereclause = " dbo.Rotavirus.caseid = '" & Me.Caseid_txt.Value & "'"

    DoCmd.OpenForm "Rotavirus 2 - Case Report", acNormal, , whereclause
    DoCmd.Close acForm, Me.Name

    End Sub
    Private Sub PrevPage_cmd_Click()
    MsgBox "There is no previous page. You are on page one.", vbOKOnly, "No previous page"
    End Sub

    Private Sub Site_list_BeforeUpdate(Cancel As Integer)

    End Sub

    Private Sub Site_txt_BeforeUpdate(Cancel As Integer)

    End Sub

    Private Sub Switch_cmd_Click()

    DoCmd.OpenForm "Main Switchboard", acNormal
    DoCmd.Close acForm, Me.Name

    End Sub

    Private Sub Switch_cmd_Exit(Cancel As Integer)

    End Sub
    --------------
    Pardon the earlier wrong posting on an existing Thread.
    Thanks- idi

  2. #2
    Join Date
    Nov 2009
    Posts
    49
    Hi,

    I am sorry but I can't see Site_List in your coding...

    Except at the beginning where you are locking the control that ends in List.

    Is Site_List a control on your form?

    This might be the problem as you are locking the control, no one can modify it, therefore you cannot enter any data into this control. Of course this is only true if Site_list is a control on your form, although you are making the control invisible to the naked eye with .width = "0" and .height = "0" so not sure how you can enter data into something you can't see...

    I must of missed something...

  3. #3
    Join Date
    Dec 2009
    Posts
    6
    Hi Pb,
    Pardon the delayd response/ clarification.
    I have combined the databse including (checking view hidden objectis in the navigation bar) but couldn't find the tables (or combos?) refernced as site_list, transfer_list, etc.
    But I am attaching some snapshots of the the database proterties in design view with StudySite highted and Site_text showing. I hope this will reveal the magic bullet. The Studysite window was originally almost closed (as with the others below it (next to Cincinati and Provider)) but I opened it for clearer view.
    Thanks again- idi
    Attached Files Attached Files

  4. #4
    Join Date
    Nov 2009
    Posts
    49
    Aha I think I can see it...

    Column shouldn't be in square brackets so...

    =Site_List.Column(1)

    just like you have lower down for "Child Has Insurance?"

    = ChildInsur_list.Column(1)

    Have a try and see if that works.

    Phil

  5. #5
    Join Date
    Dec 2009
    Posts
    6

    Smile

    Thanks for helping; unfortunately that is not working yet. I looked in the codes and didn't find any difference between the ChildInsurace and the Site_list.
    When I manually delete the bracketes arround Site_list and Column in properties View, it automatically returns (it is by some default). I added the brackets arround ChildInsrance and tried to edit the field in form view and got the same error term (i.e, control can't edit; it's bound to expression). It also appears that one I add the brackets , I can't take them out.
    idi

  6. #6
    Join Date
    Nov 2009
    Posts
    49
    Hi,
    how strange...

    Could I get you to do a screen shot of data tab on properties for the textbox and also ChildInsurance (further down) and it's textbox?

    Also I was kinda wondering why you had those listboxes, because as the form opens you can't see Site_List to change it? If that is right then there is a way that you won't need a listbox.

    Phil

  7. #7
    Join Date
    Dec 2009
    Posts
    6
    I am not sure if I understand exactly what a data tab is.
    But I have attached screen shots of the textbox for Site_list and also for the ChildInsrance
    I also noticed when you hit Tab on the Site_list, it takes you directly to months (ChildAge)
    Thanks for helping- idi
    Attached Files Attached Files

  8. #8
    Join Date
    Nov 2009
    Posts
    49
    You were correct in the properties window there is a tab called data.

    Don't need to worry about the Tab key situation that is all down to Tab Order, that won't affect whats happening. You can sort that out later.

    The more and more I look at it the more I don't like the square brackets around Column! Square brackets usually denote a field or form. Just to check you don't actually have a form called Site_list do you?

    Other than that your previous post said that if you added brackets then you couldn't get rid of them again. Is it worth deleting the current textbox and making a new one and put in the coding that I wrote above?

    =Site_List.Column(1)

    And just to check again, can the listboxes be seen by the user? or are you going to have it so the main users can't see it, then a person in charge can enter a password and be able to modify the records? If neither are true then there are other ways to sort out this hiccup.

    Phil

  9. #9
    Join Date
    Dec 2009
    Posts
    6
    No, I cannot find a form called site_list. I believe it is a combo that was renamed as such.
    I do have a table called Sites, but I don't believe it has anything to do with this.
    I have deleted the textbox for Site_list and added a new one without typing the brackets but the sysytem automatically inserted the brackets.
    No the list boxes cannot be seen by the user. I will be the main user, and I will not need to provide any other persons password to modify the data.
    Thanks- idi

  10. #10
    Join Date
    Nov 2009
    Posts
    49
    If that is the case why don't use just convert the listbox to a combobox (right click on Site_list and there is a menu option to convert) and get rid of 1,2 and 3 from the rowsources leaving just the places behind? to be honest I am not sure why you are using a listbox in the middle of this if it can't be physically click on it.

Posting Permissions

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