'Not a Valid bookmark' error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • auburnzx
    New Member
    • May 2007
    • 1

    #1

    'Not a Valid bookmark' error

    Hi Everyone,

    I’m new here and also just beginning to learn VBA.

    I’m setting up a new database. The main form (which is bound to a table) has a lot of controls for staff to enter info into. For reasons I won’t go into I have set every control with a green background which goes white if text is entered:


    Code:
    Private Sub txtName_LostFocus()
    If IsNull(Me.txtName.Value) Then
        Me.txtName.BackColor = RGB(0, 255, 128)
        Else
        Me.txtName.BackColor = RGB(255, 255, 255)
    End If
    End Sub
    My question:
    Is there a way of scripting this economically, without having to repeat the above code for every control in the form (upwards of 100). I have browsed several books but cannot find anything that helps with this.

    At present the form works fine until I start entering text into memo fields (about a dozen of these). If I type in more than four words then try to save or open a new record I repeatedly get the message, “Not a valid bookmark” or 'You can't go to the specified record".

    I have checked all my current coding, nothing is amiss so maybe I need more RAM? On another form I am getting an ‘Out of memory message’.

    Would appreciate any help as I’m completely stuck.
  • Dököll
    Recognized Expert Top Contributor
    • Nov 2006
    • 2379

    #2
    Originally posted by auburnzx
    Hi Everyone,

    I’m new here and also just beginning to learn VBA.

    I’m setting up a new database. The main form (which is bound to a table) has a lot of controls for staff to enter info into. For reasons I won’t go into I have set every control with a green background which goes white if text is entered:


    Code:
    Private Sub txtName_LostFocus()
    If IsNull(Me.txtName.Value) Then
        Me.txtName.BackColor = RGB(0, 255, 128)
        Else
        Me.txtName.BackColor = RGB(255, 255, 255)
    End If
    End Sub
    My question:
    Is there a way of scripting this economically, without having to repeat the above code for every control in the form (upwards of 100). I have browsed several books but cannot find anything that helps with this.

    At present the form works fine until I start entering text into memo fields (about a dozen of these). If I type in more than four words then try to save or open a new record I repeatedly get the message, “Not a valid bookmark” or 'You can't go to the specified record".

    I have checked all my current coding, nothing is amiss so maybe I need more RAM? On another form I am getting an ‘Out of memory message’.

    Would appreciate any help as I’m completely stuck.
    I would also add this to the Access forum, auburnzx!

    Hopefully this is not getting to you too late...

    It's probable a Module can help you you handle the background colour, that be the case here:

    Code:
    If IsNull(Me.txtName.Value) Then
        Me.txtName.BackColor = RGB(0, 255, 128)
        Else
        Me.txtName.BackColor = RGB(255, 255, 255)
    End If
    The above should be the Module that is called, how 'bout that?

    Comment

    Working...