Access features...



  • This one is short - message from Access when running a VBA code:

    Run-time error 2185
    You can't reference a property or a method for a control unless the control has the focus
    WTFingF??????????????
    For all people saying "Real WTF is that you're using Access" -> I have to complete a project for my WTFU. Yes - in Access. Yes - for DB design course. Yes - I've got to build a working app.


  • @viraptor said:

    ... Yes - I've got to build a working app.

     This is the best part of this post.  I never took a programming class in college, specialing in hippie culture instead.  But I would assume that most any class would require the app to work.  JMHO.



  • Yes this is annoying, yes it is stupid.  yes there are two solutions.

    Either use control.setfocus before using it, or if you are trying to get the default property just use control, it will pull the default value without having focus set.

    Suffer through it, once you graduate you will realize the real world isn't much different.
     



  • @pauluskc said:

    @viraptor said:

    ... Yes - I've got to build a working app.

     This is the best part of this post.  I never took a programming class in college, specialing in hippie culture instead.  But I would assume that most any class would require the app to work.  JMHO.

     

    This depends on the level of your school.  In community colleges, as long as you don't spell computer with a 'u' and 2 o's, you'll get a 75% grade.



  • @MyWillysWonka said:

    @pauluskc said:
    @viraptor said:
    ... Yes - I've got to build a working app.

     This is the best part of this post.  I never took a programming class in college, specialing in hippie culture instead.  But I would assume that most any class would require the app to work.  JMHO.

    This depends on the level of your school.  In community colleges, as long as you don't spell computer with a 'u' and 2 o's, you'll get a 75% grade.

    Just for this forum, it is rather WTFey as most people seem to be programmers / reasonably decent human beings who would try to write a complete program that runs vs. something poopy for their cuumpewtor.  At least, I strive to do my best on whatever tasks there are..



  • @KattMan said:

    Yes this is annoying, yes it is stupid.  yes there are two solutions.

    Suffer through it, once you graduate you will realize the real world isn't much different.

    I do the setfocus, but haven't found a way to get a control that has focus now, to return to it later.

    I don't know about the world you're living in, but I've been doing database + programming for a bit now (@univ. != without real experience) and I haven't seen anything that stupid yet.
    Though having to do:
    if(... is the same thread as gui...) control.value = whatever;
    else control.invoke(....);
    manually instead of including it into default property setter is pretty close too. (this one has an explanation at least...)

    The "working app" part was about making an app that doesn't blow up when you click not the right button - that would be easy in Access.
    + I haven't seen a real "working app" in access yet...



  • @viraptor said:

    @KattMan said:

    Yes this is annoying, yes it is stupid.  yes there are two solutions.

    Suffer through it, once you graduate you will realize the real world isn't much different.

    I do the setfocus, but haven't found a way to get a control that has focus now, to return to it later.

    I don't know about the world you're living in, but I've been doing database + programming for a bit now (@univ. != without real experience) and I haven't seen anything that stupid yet.
    Though having to do:
    if(... is the same thread as gui...) control.value = whatever;
    else control.invoke(....);
    manually instead of including it into default property setter is pretty close too. (this one has an explanation at least...)

    The "working app" part was about making an app that doesn't blow up when you click not the right button - that would be easy in Access.
    + I haven't seen a real "working app" in access yet...

    What?  You've never seen totally asinine specifications written up by management that doesn't know their T1 from a coffee cup and expect you to make it work they way they designed it even if you know better?  Just how long have you been in the real world?  ;)



  • @viraptor said:

    I do the setfocus, but haven't found a way to get a control that has focus now, to return to it later.

    I'm assuming you are working with a form.  Have you tried Me.ActiveControl?  It's been so long since I've done Access/VBA, I'm not sure if that's worked for me or not.
     



  • @viraptor said:

    This one is short - message from Access when running a VBA code:

    Run-time error 2185
    You can't reference a property or a method for a control unless the control has the focus

    WTFingF??????????????
    For all people saying "Real WTF is that you're using Access" -> I have to complete a project for my WTFU. Yes - in Access. Yes - for DB design course. Yes - I've got to build a working app.

    yeah, it can be annoying, but not it's not all properties, just some of them. The error message is misleading. For example, I know you can reference the Value property without the control having the focus.  what are you trying to do with the control? 
     



  • @lpope187 said:

    @viraptor said:

    I do the setfocus, but haven't found a way to get a control that has focus now, to return to it later.

    I'm assuming you are working with a form.  Have you tried Me.ActiveControl?  It's been so long since I've done Access/VBA, I'm not sure if that's worked for me or not.

    Me.ActiveControl = null (or whatever vba equivalent is)
    Now the real problem is when abc_control.SetFocus doesn't work.

    If someone wants to try:
    - create Form with header with textboxInHeader
    - create script for textboxInHeader_change:

    dim a
    textboxInHeader.setFocus
    a=textboxInHeader.value
    somethingElse.setFocus
    doWhatever
    Me.Requery
    textboxInHeader.setFocus
    textboxInHeader.selStart = len(textboxInHeader.value)

    - run form
    - change text in textboxInHeader - everything works
    - set focus on a control in form, go back to textboxInHeader and change it
    - runtime error on line just after textboxInHeader.setFocus - control has to have focus...
    - head -> desk, repeat



  • @viraptor said:

    Me.ActiveControl = null (or whatever vba equivalent is)
    Now the real problem is when abc_control.SetFocus doesn't work.

    If someone wants to try:
    - create Form with header with textboxInHeader
    - create script for textboxInHeader_change:

    dim a
    textboxInHeader.setFocus
    a=textboxInHeader.value
    somethingElse.setFocus
    doWhatever
    Me.Requery
    textboxInHeader.setFocus
    textboxInHeader.selStart = len(textboxInHeader.value)

    - run form
    - change text in textboxInHeader - everything works
    - set focus on a control in form, go back to textboxInHeader and change it
    - runtime error on line just after textboxInHeader.setFocus - control has to have focus...
    - head -> desk, repeat

    I know timing can be an issue, but I can't duplicate the issue based on what I tested.  Here's what I have in VBA and it works flawlessly going back and forth setting focus manually with mouse clicks.

    Private Sub HeaderTextBox_Change()
        Me.SetFocus
       
        Me.MainTextBox1.SetFocus
        Me.MainTextBox1.Value = Me.HeaderTextBox.Value
       
        Me.HeaderTextBox.SetFocus
       
        If IsNull(HeaderTextBox.Value) Then
            Me.HeaderTextBox.SelStart = 0
        Else
            Me.HeaderTextBox.SelStart = Len(HeaderTextBox.Value)
        End If
           
    End Sub

    I have another TextBox in the main area of the form that I'm switching to with the mouse and then going back to the header area.  I tried this in Access 2007 and 2002 and it works in both places.
    I'm assuming it's blowing up on the area I emphasized.  You might try adding the Me.SetFocus at the top like I do, that might clear it up.

     



  • Ugh I remember taking a "Database programming" class, they didn't mention what database format we'd be messing with, just that it was a required course to get on to more advanced administration and programming with stuff like Oracle. Yes it turned out to be Access, and it was painful to get through because of WTFs like this.

    And no, you don't necessarily have to make a working application, as long as you put forth a good effort and can somewhat explain why it doesn't work, the teachers are usually apathetic enough to let you slide with a B.

    By the way... 

    @MyWillysWonka said:

    ...as long as you don't spell computer with a 'u' and 2 o's, you'll get a 75% grade.

    "computer" is supposed to have one of each at the very least.



  • I dont know why everyone is fussing about access?

    Its a very solid DB if you dont place it on any network drive, process more then 2 records and also obey the 1-concurrent User limit..



  • I guess I'm one of the lucky ones, when I took my DB classes in college they involved SQL, not Access



  • @PsychoCoder said:

    I guess I'm one of the lucky ones, when I took my DB classes in college they involved SQL, not Access

    If the class is an intro to relational data modeling and sql, then Access is fine.  The worst thing about Access is that it confuses people and perpetrates the confusion between data and presentation, since Access mingles them both together in 1 application. But for learning about data types, normalization, sql, relations, and so on, Access is fine.  That's how I learned.



  • @pauluskc said:

    @viraptor said:

    ... Yes - I've got to build a working app.

     This is the best part of this post.  I never took a programming class in college, specialing in hippie culture instead.  But I would assume that most any class would require the app to work.  JMHO.

    I had a sophomore level programming class that was a prerequisite for all advanced CS classes where 40% of the grade was for confirming to the specified coding style.  So you could have a 50% pass rate on the programs and do reasonably well on the exams to get a B.



  • What precisely are you trying to accomplish with the code?  I saw your sample, but it has too many "I have some code here" lines in it.  When I tried to duplicate it (by plugging in my own code), I didn't get the error you're getting.

    I've built a very complex, very functional Access front end application (on top of SQL).  I might be able to help.



  • You can (sortof) get around the "control must have focus to read it's properties" issue by exploiting the default properties of the controls...

     For instance, you can get away with this:

         myString = Text1 & " " & Text2

    but not this:

         myString = Text1.Text & " " & Text2.Text

     



  • @Gsquared said:

    What precisely are you trying to accomplish with the code?  I saw your sample, but it has too many "I have some code here" lines in it.  When I tried to duplicate it (by plugging in my own code), I didn't get the error you're getting.

    I've built a very complex, very functional Access front end application (on top of SQL).  I might be able to help.

    Agreed.  I see no problems with the code, either -- it works fine for me; you have not given us enough info.



  • @RaspenJho said:

    You can (sortof) get around the "control must have focus to read it's properties" issue by exploiting the default properties of the controls...

     For instance, you can get away with this:

         myString = Text1 & " " & Text2

    but not this:

         myString = Text1.Text & " " & Text2.Text

     

    The default property being used is "Value", not "Text", which you can access without the control having the focus. 



  • @MyWillysWonka said:

    This depends on the level of your school.  In community colleges, as long as you don't spell computer with a 'u' and 2 o's, you'll get a 75% grade.

    I went to a community college.  that's a pretty ignorant statement to make; I assume you were trying to be funny?   Do you also make funny jokes about the "morons" that don't have the money to attend private schools and private colleges as well?  Nice stuff.



  • @pauluskc said:

    @MyWillysWonka said:
    @pauluskc said:
    @viraptor said:
    ... Yes - I've got to build a working app.

     This is the best part of this post.  I never took a programming class in college, specialing in hippie culture instead.  But I would assume that most any class would require the app to work.  JMHO.

    This depends on the level of your school.  In community colleges, as long as you don't spell computer with a 'u' and 2 o's, you'll get a 75% grade.

    Just for this forum, it is rather WTFey as most people seem to be programmers / reasonably decent human beings who would try to write a complete program that runs vs. something poopy for their cuumpewtor.  At least, I strive to do my best on whatever tasks there are..

     I wish that were the case.  I certainly would have felt much less isolated while in school.  I actually have been told, in a most wiltingly scronful manner, "Ishould've figured that you'd try to write a working program ... Let me make one thing clear: I don't intend to do any more work in this course than I need to get my A".

    WTF!

    Ironically, most of my classmates who took on this attitude seem to have gone on to well-paying jobs in IT, while I have been seeking work unsuccessfully for over a year.  Makes me wonder just what the IT industry wants to encourage.


     



  • Actually... this philosophy:

    I don't intend to do any more work in this course than I need to get my A

    fits perfectly into most corporate cultures.  The Agile/XP paradigms even have rules that say implement the quickest/easiest solution that can possibly work.  I am constantly having to evaluate the trade-offs between completeness and accuracy versus cost and consistency.  It grates on my nerves, but it's what the companies want.



  • @Jeff S said:

    @MyWillysWonka said:

    This depends on the level of your school.  In community colleges, as long as you don't spell computer with a 'u' and 2 o's, you'll get a 75% grade.

    I went to a community college.  that's a pretty ignorant statement to make; I assume you were trying to be funny?   Do you also make funny jokes about the "morons" that don't have the money to attend private schools and private colleges as well?  Nice stuff.

     Well, there's always the chance he's referring to the quality of the education and not the quality of the students. (probably not, but who can say.)

     
    If he were talking about the quality of education, I'd say he's dead on, because I was overqualified to teach every one of the computer classes I took while I was getting my AS and AAS degrees at a community college (save, perhaps, 2). They have since accepted a large amount of money to change from "practical" teaching to teaching to certifications. Taking the cert tests are required in some courses, though passing them isn't. It's retarded from top to bottom. 


Log in to reply