From: FKlusmann via AccessMonster.com on 16 Jan 2010 20:28 Douglas J. Steele wrote: >You sure Line01, Line02 etc are text boxes and not some other type of >control and that they're unbound? Yes sir, nothing on this test form is bound. Also, I cannot figure the type mismatch in (new problem): varResult = DLookup("[line]", "TextTest01", "[sel] = '" & selct & "'" And " [lineNo] = " & ctr) Thank you. -- Fred -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201001/1
From: Marshall Barton on 17 Jan 2010 11:52 FKlusmann via AccessMonster.com wrote: [snip] >I tried your suggested: >[Quote] >Private Sub Form_Open(Cancel As Integer) [snip] > Me.Controls(txtboxname).Value = varResult [snip] >But get �Run-time error �2448�: You can�t assign a value to this object� at >the line > Me.Controls(txtboxname).Value = varResult The Open event is probably too early to set a control's value. Try the Load event instead. -- Marsh MVP [MS Access]
From: FKlusmann via AccessMonster.com on 17 Jan 2010 16:25 Marshall Barton wrote: >[snip] >The Open event is probably too early to set a control's >value. Try the Load event instead. I tried, but that does not work either. I've about convinced myself that there is no way to program change in text box names. Thanks for trying! -- Fred -- Message posted via http://www.accessmonster.com
From: Marshall Barton on 17 Jan 2010 17:19 FKlusmann via AccessMonster.com wrote: >Marshall Barton wrote: >>[snip] > >>The Open event is probably too early to set a control's >>value. Try the Load event instead. > >I tried, but that does not work either. > >I've about convinced myself that there is no way to program change in text >box names. > >Thanks for trying! Well, I tried, but your "that does not work either" doesn't say much for your effort. What happened? Did you get the same error? A different error? What code did you use when you tried it? I have done this kind of thing many times and I suspect that Doug has too, so, the devil being in the details, I'm guessing there is still a probelm or two in your code. -- Marsh MVP [MS Access]
From: Steve Sanford "limbim53 at yahoo dot on 17 Jan 2010 19:12 You have double quotes in the wrong place. The line should be: varResult = DLookup("[line]", "TextTest01", "[sel] = '" & selct & "' And [lineNo] = " & ctr) HTH -- Steve S -------------------------------- "Veni, Vidi, Velcro" (I came; I saw; I stuck around.) FKlusmann via AccessMonster.com wrote: > Douglas J. Steele wrote: >> You sure Line01, Line02 etc are text boxes and not some other type of >> control and that they're unbound? > > Yes sir, nothing on this test form is bound. > > Also, I cannot figure the type mismatch in (new problem): > varResult = DLookup("[line]", "TextTest01", "[sel] = '" & selct & "'" And " > [lineNo] = " & ctr) > > Thank you. > -- Fred >
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 Prev: Curious Reaction to subform SQL statement Next: IF in a forms ON Load event... |