Results 1 to 3 of 3
  1. #1
    Join Date
    May 2002
    Posts
    395

    Unanswered: Why can't I assign a value to a textbox?

    Why can't I assign a value to a textbox?
    The tblEndingMo is the recordsource for the form and EndinMo is the controlsource for textbox.
    Error Message " You can't assign a value to this object"

    Dim eMonth as Date

    Public Sub GetNewMo()

    Dim dbs As Database
    Dim rst As Recordset


    Set dbs = CurrentDb()
    Set rst = dbs.OpenRecordset("SELECT * FROM tblEndingMo")

    eMonth = rst!EndingMo
    eMonth = DateAdd("m", 1, eMonth)
    Forms!frmDateRange!txtEndingMonth = eMonth

    End Sub

    Thanks!!

  2. #2
    Join Date
    Nov 2002
    Location
    Hillsboro, OR, USA
    Posts
    59

    Question Re: Why can't I assign a value to a textbox?

    Can you manually enter a record into the textbox?

    Brian

  3. #3
    Join Date
    May 2002
    Posts
    395

    Re: Why can't I assign a value to a textbox?

    Originally posted by bri
    Can you manually enter a record into the textbox?

    Brian
    Yes, it did allowed me to enter a record on the form as well as in the table. I fixed the problem by removing the tbl and txtbx as control source and it, then allowed me to store the new value in the field.

    Thank you so much for your reply.
    Have a Good Day!
    (I'm sure it's a lot easier for you to Have a Good Day since you don't have the cold and snow like we do here in Buffalo)
    Thanks again

Posting Permissions

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