Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 40
  1. #16
    twgonder is offline Expert
    Windows 10 Access 2021
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    658

    Video of crash happening with data entry



    Quote Originally Posted by CJ_London View Post
    Sorry don’t have time to speculate. Provide proper information or don’t bother. syntax errors typically show as red when you are typing it and complete a line. Compile errors (assuming you are using option explicit) relate to early bound objects - so no error means not a problem there. Run time errors relate to late bound objects and data
    Okay, you asked for it... I'm joking.
    I've tried to duplicate the error with a simplified .accdb, it doesn't crash, as of yet.
    So, I made a video of the crashing with the larger .accdb and the offending code.
    I presume it's the size and the complexity of the VBA code that causes that particular line of code to crash Access.

    If I do this right, the video should be visible here:
    https://1drv.ms/v/s!AmMsCrz5d72TgZJ4Ei3DYHD-QdvhTg?e=PQsPbb

  2. #17
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    Link doesn't work for me and really not interested in looking at a video. What works for me is copy/pasted code in code tags and the odd screenshot. Plus detail such as error messages. Or an uploaded db to illustrate the issue with clear instructions how to replicate the issue

    I presume it's the size and the complexity of the VBA code that causes that particular line of code to crash Access.


    size should not be a problem, and complexity just means you are not doing something correctly.

    Since you can't answer a simple question (post #13) I'm going to drop out (again)



  3. #18
    twgonder is offline Expert
    Windows 10 Access 2021
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    658

    All answered in the video, but here we go...

    Quote Originally Posted by CJ_London View Post
    What does crash mean? You get an error, it freezes? It closes.
    Access pauses then closes without any error messages. Sometimes it's reported to not respond, with an hourglass (indicating some kind of loop, but it's not a loop in my code as the error happens without any of my VBA code running--as best as I can tell).

    What do you have in the way of error handling?
    This code that is causing the problem, I think, is in the Form_Error procedure. There are no on error statements, so if a line of code was failing, there should be a runtime error at that line, but there isn't any run'time error happening. The crash doesn't seem to happen when a line of code runs, rather when an alpha character is entered in a textbox (with corresponding error code) for a numeric field and then another control is clicked on. The error doesn't happen with a tab, only with click.

    Are you using option explicit? The list goes on
    Yes, option explicit is there. But as I said, it seems to be a problem within Access and not in the running VBA code of my form. I presume it's a deep Access bug where complex code is stomping on itself with the correct condition set by the developer's code.

    I'm not sure why you can't see the video, try the link again if you would please. OneDrive does give me fits. The video is in a public folder, other users have been able to use my links to see other files, but who knows in this case (I can see it, but then it's my OneDrive)? Are there any error messages from OneDrive that indicate why the link doesn't work?

  4. #19
    twgonder is offline Expert
    Windows 10 Access 2021
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    658

    Sample of the .accdb and instructions on the crash

    For those that want to see it in action, not just in the video, I've stripped down the code and added the .accdb here.

    Run the file, later if Access wants to run in safe mode, you may, it won't make a difference.

    From the Main Menu click on MyForm2_2
    Click in the My Number textbox
    Replace the 10 with "a", press tab, wait 5 seconds
    Click in the My text textbox.
    If not an immediate shutdown of Access, then wait 20 seconds
    Press tab again, wait 5 seconds
    Click in the My Text textbox (or any textbox above). Click image for larger version. 

Name:	220105Crash2.jpg 
Views:	17 
Size:	118.0 KB 
ID:	49433

    Technically, the My Text won't get focus because an error still exists in the My Number textbox,
    but the fact that you can click there should mean no VBA code is running.

    I know I've made a few assumptions/presumptions in this and prior posts, but we have to start somewhere in debugging, even if they prove wrong later.

    The video shows the lines to comment out to make the crash stop happening, but here it is:

    Click image for larger version. 

Name:	220105Crash2-2.jpg 
Views:	17 
Size:	184.8 KB 
ID:	49435

    I'm using Windows 10 22H2 19045.2364 with Access 2021 ver. 2211 build 15381.20208
    I'm getting the crash on two different laptops (not identical), running the same version of Access.
    Attached Files Attached Files

  5. #20
    twgonder is offline Expert
    Windows 10 Access 2021
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    658

    Simpler version of form without crash

    The error can be had by putting in My Date an "a" (not valid date), tab, and then click in another textbox.
    You will have to F5 through the stop, but the crash will happen, maybe more dramatically.

    Also, here is an extremely chopped down version of most of the essential code where the problem occurs,
    but it doesn't happen in this wizard created, minimal VBA version. So, there's something in the size or complexity that's causing the problem,
    unless the crash will happen for someone else doing the testing on this smaller .accdb file.
    Attached Files Attached Files
    Last edited by twgonder; 01-05-2023 at 09:20 PM. Reason: add more ingo

  6. #21
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    I tried your crash2 db - could not replicate the error although the messages are a bit confusing

    Click image for larger version. 

Name:	image_2023-01-07_002555669.png 
Views:	20 
Size:	5.2 KB 
ID:	49457

    similarly with the date field - control format is dd/mm/yyyy, whilst requested format is yyyy/mm/dd. Entering as yyyy/mm/dd works however
    Click image for larger version. 

Name:	image_2023-01-07_004634458.png 
Views:	20 
Size:	10.4 KB 
ID:	49458

    I'm sure they are only teething problems

    so if you are having problems, it may be your messages are getting mixed up since for myNumber one is saying between 2 and 2 characters which implies a text entry

  7. #22
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    With such a restrictive period of available input dates why not remove all the pain and simply have a combo box listing them?
    You could do the same with the numbers if they can only enter 10 to 99 ?

    Just a thought.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  8. #23
    twgonder is offline Expert
    Windows 10 Access 2021
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    658

    Some teething, and some not

    @ CJ_London Thanks for doing the test. I'm trying to narrow down why it's crashing on my two laptops and not others, although it's hard to find two that are the same, even mine are somewhat different, but both running Windows 10 with Access 2021.

    But to be sure, you did enter an "a" in MyNumber, press tab (maybe a few times, getting the error messages), wait a few seconds and then try and CLICK on MyText, and again wait maybe 20 seconds? If it's going to crash, you'll know it as the application hangs and you can't do tab again or anything. You might get the hour-glass, but it's not consistently there.

    There are cascading levels to the validation tests, first is if it's a number, then its size and then the range of values. Similar with dates. Depending on what you enter, you will get a different error. (In the Crash2.accdb VBA code, you are seeing only 10% of the validations that will ultimately be used.)

    The date fields are entered and then validated by Access first to see if it's a date. There are many formats that Access allows. I use the region settings to display the dates, so each user has control over that, I just prefer to enter in the ISO manner (YYYYMMDD) to eliminate confusion, as I often see MM/DD and DD/MM living in South America. When I see a date as 01/02/03, I often have no idea what it could mean.

    The size error message is showing the upper and lower number of digits to enter. Works the same for numbers as well as text entry. So, one can enter from 10 to 99 (to comply with 2 digits requirement), but as a test you can see that the range is 11 to 98. Look at the orange highlights if you can see them:

    Click image for larger version. 

Name:	220107Crash3.jpg 
Views:	12 
Size:	88.8 KB 
ID:	49464

    Remember, the db is mostly for testing various scenarios, so it's a mixed bag of deliberate "errors" and bugs.


    Last edited by twgonder; 01-07-2023 at 09:06 PM. Reason: add image

  9. #24
    twgonder is offline Expert
    Windows 10 Access 2021
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    658

    Combo box option?

    @ Minty Well, it's just a test of the range feature. But if it was a combo box, it would be about 180 rows.
    It could just as well be a range of two years with this simple change:

    Click image for larger version. 

Name:	220107Crash1.jpg 
Views:	12 
Size:	34.0 KB 
ID:	49462

    producing this validation message:

    Click image for larger version. 

Name:	220107Crash2.jpg 
Views:	12 
Size:	34.3 KB 
ID:	49463

    let's see, that would be how many rows in the combo box?...um, I think not.

    Anyways, did you do the crash test? What was the result? What versions of Windows and Access are you using, if I may ask?
    Last edited by twgonder; 01-07-2023 at 06:30 PM. Reason: add images

  10. #25
    twgonder is offline Expert
    Windows 10 Access 2021
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    658
    In case anyone is confused by the number of posts and variety of questions, Crash2 is just part of a bigger prototype that I've been asking questions for. And as features are shaken out in the next larger prototype test, they get added to the development environment, which has a shell around Access to accommodate the 3+ million lines of code being ported from a forty-year application.

    Ultimately, the data you see in the Valdt() array will be placed in the shell records, not hard coded, much like the RAD/app did some 40 years ago in its db environment. These are just test validations parameters that Microsoft forgot to design into Access on day one, so we are working to accommodate (and now test just a few of) the features needed and present in the old RAD/app design.

    In other words, this is just simple testing of how Access does and doesn't handle some requirements. Much to my chagrin, we're spending a lot more time working around some quirky designs and bugs in Access than I anticipated. Hence my somewhat critical exasperations at times. I would much rather be moving ahead in the project and managing the team than bothering you all with WTF questions that seem to come up hourly around here. Thanks for your understanding and help in all this.

  11. #26
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    But to be sure, you did enter an "a" in MyNumber, press tab (maybe a few times, getting the error messages), wait a few seconds and then try and CLICK on MyText,
    I followed your instructions - several times
    Click in the My Number textbox
    Replace the 10 with "a", press tab, wait 5 seconds
    Click in the My text textbox.
    If not an immediate shutdown of Access, then wait 20 seconds
    Press tab again, wait 5 seconds
    There are cascading levels to the validation tests
    I worked that out, I use a different method which does all the checks which always asks for the right data and doesn't leave the user guessing what is actually required - where appropriate I also use the control format property to show the user what format the data is required in. I also use code to prevent users entering characters not valid the data type

    Ultimately, the data you see in the Valdt() array will be placed in the shell records, not hard coded, much like the RAD/app did some 40 years ago in its db environment.
    I presume by shell records, you mean a meta table - if so, a common technique, I use that all the time for data input, importing and things like calculated values that could end up out of range.

    These are just test validations parameters that Microsoft forgot to design into Access on day one
    really? name them. Other than a dynamic date or number range, I can't think of one.

  12. #27
    twgonder is offline Expert
    Windows 10 Access 2021
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    658
    Quote Originally Posted by CJ_London View Post
    ...

    really? name them. Other than a dynamic date or number range, I can't think of one.
    Well, you just named two, and then you can look at most of the things you had to put in your "meta table".
    One poor sap (it'll probably be me) is going to port all my old code that validates addresses, geographic areas, phone numbers and zip codes, etc. for a host of countries.

  13. #28
    twgonder is offline Expert
    Windows 10 Access 2021
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    658
    Quote Originally Posted by CJ_London View Post
    I followed your instructions - several times...
    Thank you for doing that. I think you mentioned there were no problems.
    May I ask what versions of Windows and Access you tested with?
    I'm trying to narrow down why my laptops are crashing and not other computers.

  14. #29
    twgonder is offline Expert
    Windows 10 Access 2021
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    658
    Quote Originally Posted by CJ_London View Post
    ...

    I presume by shell records, you mean a meta table - if so, a common technique, I use that all the time for data input, importing and things like calculated values that could end up out of range.....
    Kinda, think of MS templates and the old table wizard all wrapped up in one. The "meta table" will actually be its own shell application, with many tables and records.
    In the old RAD, we had "properties" that did things for the app rather than 50+ for what colors, font or style type to use for hover, borders, background, foreground, etc. of controls.

  15. #30
    twgonder is offline Expert
    Windows 10 Access 2021
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    658

    Thumbs up Messages and formats

    Quote Originally Posted by CJ_London View Post
    ...
    I worked that out, I use a different method which does all the checks which always asks for the right data and doesn't leave the user guessing what is actually required - where appropriate I also use the control format property to show the user what format the data is required in. I also use code to prevent users entering characters not valid the data type...
    It's all good, I could do the same by commenting one or two lines of code. I try not to overload the textbox with messages (unless for debugging). I find most experienced users need just one prompt to realize they were entering in a different field than they thought. Hence, the cascade order.

    I used to use formats, but that was part of a system that used "meta data" and depending on which country or maybe even something like phone type (as an example, there are countries that had different formats for fax numbers, and I know from first-hand experience they've done the same with cell phones; dang, even the land-line "area codes" here ranged from 1 to 3 digits!), formats could be modified during entry. And this is just the simple stuff, it gets a lot more complicated with the different legal systems and social norms which the porting app has to deal with. We're not yet there with Access, but getting there.

Page 2 of 3 FirstFirst 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Number Wildcards in String
    By pjordan@drcog.org in forum Queries
    Replies: 11
    Last Post: 10-25-2018, 02:01 PM
  2. Replies: 6
    Last Post: 01-18-2016, 02:59 PM
  3. Extract number from String
    By DOSRoss in forum Programming
    Replies: 26
    Last Post: 04-28-2015, 06:07 AM
  4. Replies: 0
    Last Post: 10-22-2012, 02:45 PM
  5. How to Convert string to Number?
    By taimysho0 in forum Programming
    Replies: 1
    Last Post: 02-24-2012, 01:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums