Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Join Date
    Aug 2006
    Posts
    25

    Question Unanswered: Pressing the "Tab" or "Enter" Key makes the fields go blank

    When I select a value from the combo box, and click anywhere on the form the values get populated in the other fields.

    However, if I press the Tab or the Enter key after selecting the value from the combo box, all fields go blank, including the field on the Combo Box, but it does save the values in the table.

    Can anyone help me with this issue please?

    Thanks,
    CompPal

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    What does your code look like to populate the rest of your fields? Where does it get called from and in which event?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Aug 2006
    Posts
    25
    Teddy,

    I don't know much about coding nor event procedures. I would love to know more.

    The data for the Control Box comes through RowSourceistinctRow query, and the rest of the data comes from ControlSource query.

    If I need to set up an event procedure, please let me know how to do it.

    Thanks!

  4. #4
    Join Date
    Aug 2006
    Posts
    25
    Someone, please help me.

    What event procedure or code do I need to use to fix the problem I'm having?

    I would like the data to stay still after selecting it from the Combo Box, whether I click, tab, or use the enter key after selecting the record .

  5. #5
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    I'm wondering if it isn't a tab order thing and your combo box is the last item in the order (and the form's cycle event <> current record - should be current record to not go to a new record after the last field). You may also try using a me.myfieldname.setfocus command which also might help if it's an order problem.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  6. #6
    Join Date
    Aug 2006
    Posts
    25
    Thanks!
    I'll check the tab order to see if it's the last item on the form tomorrow at work. I hope the solution will be as easy as fixing the tab order.

    Otherwise I have to figure out how to set the code for cycle event
    (I don't see any event with the name "cycle").

    If I need to use the me.myfieldname.setfocus code, would it be a one-line code? or I need to use it with an event procedure. If so, which event procedure and what other codes?

    I'm sorry for being such a pain. It's my first time I'm designing a database where I have to use Visual Basics coding. Don't have any experience with it.

  7. #7
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Sorry - Cycle isn't an event. It's a property item for the form.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  8. #8
    Join Date
    Aug 2006
    Posts
    25

    Thumbs up

    It was tab order issue. When I changed the Combo-Box tab order to be the 1st, it worked beautifully.

    Thank you so much for your help.

    You are amazing!
    Comppal

  9. #9
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    You may want to look at the form's properties and the "cycle" item. You can decide if you want it to go to the next record (All Records) or stay on the current record (Current Record) when it reaches the end of it's tab order.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  10. #10
    Join Date
    Aug 2006
    Posts
    25
    Thanks. I did change the cycle on the form to be Current Record.

    Now I have another problem. It seems I have sharing problem.

    How can I set the DB so that multiple users access it and do data entry at the same time.

    I'm even getting read-only error when other users are in it and when I try to export a query to an Excel file.

    Strangely, I can export a report to an Excel file, but not a query. But whn no one is in the DB I can export a query with no problems.

    Please see the error screen shots enclosed.
    Attached Files Attached Files

  11. #11
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    Error

    It seems wierd that you're getting the error on the frm-location (I'm assuming the form name) verses an error indicating that the record in the table has been changed. I had this error occur once when I had a subform (one of the properties of the form) set to show in design mode but all of your forms seem to be showing in form view. Are the users getting into an mde or mdb file? If it's an mdb, you can possibly split the database (there's a wizard under the Tools, Database Utilities (Database Splitter) item that could help you split the front-end from the back-end) and then possibly make the front-end an mde file. You can also try the attachment (modify the location of your source mde file in it using notepad and save it back as a vbs type file) and then copy it to each of the users desktop. This would create a copy of the mde with the user's loginName and it would still point to the main tables mdb. This may solve your problem but I'm not sure if it's exactly the correct solution. I also wonder if the errors in your snapshot are related to the same problem or not. Regarding the second error, is there a make-table query in the process somewhere. I had problems with multiple user's trying to access the same table when one of the queries made a "temporary" type of table and 2 user's couldn't even open up the same report based off that temporary table. You might also try recreating the query (make a new one) and see if that helps (possibly there's a setting wrong in the query itself). You can also try re-installing Microsoft Access but that might be last resort thing.
    Other than that, the only other thing I can think of is possibly some type of permissions problem (possibly on the mdb file itself). This you look at by right clicking on the mdb/mde file itself.
    I can't think of anything more right now but I'll think about it for a bit. Others might have some answers for you also (did you also have another post on this?)
    Attached Files Attached Files
    Last edited by pkstormy; 09-30-06 at 00:08.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  12. #12
    Join Date
    Aug 2006
    Posts
    25
    Hi pkstormy,

    Yes I did have another post on this, but no one responded to it as of yet.
    When you responded to my other problem, I replied to you by adding this problem. I apologize if it created any confusion.

    Thanks for taking the time any helping me with my problems. As you can see I'm new at this Access DB design thing, especially the coding part.

    Well, let me start with the 2nd read-only error.
    This afternoon I was able to export the data from the query to an Excel file with no problem, and I came to the conclusion that the problem occurs when the other Admin is in the mdb through the back end, and yes we do have queries to make tables. I think that pretty much solves the 2nd problem.

    For the 1st error, the frm-Location is my main form which has 4 subforms. It's strange that the error says the frm-Location has been changed, because the users don't have the ability to make any changes in the form. When they select the item from the Combo box, all the other fields get populated, and I have all the fields locked. I'm assuming no data is being lost whether the user clicked on Yes or No.
    The users are using mdb front-end. So, what you're suggesting is that I can split the Db and have the users use the mde file while the Admins continue using the mdb back-end. I have never done this before, but I will certainly try it.
    My question is this, do I realy have to use the code that you have attached for each users desktop? (the script looks pretty foreign to me) If so, do I only have to make changes to the location and the database name? to replace the following code, "\\SQLServer\Databases\Databases\TimeSheet2003\Hou rs2003.mde", or do I need to make other hanges also.

    You have no idea how much I appreciate your help.

    Thanks,
    CompPal

  13. #13
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    CompPal - Don't worry about the confusion - I was just wondering which post to answer. No you don't have to use the code I supplied. All it does is it makes copies of a single front-end db adding in the LoginID name and the only advantages with it are that you can see who's in the database with the LoginID attached (an *.ldb file is present) and you can have all the user locations pointing to one central "coding" change mdb/mde file which you also would not have to have the user's close out while you make changes. Alternatively, you can also make as many front-ends as you need and then have users get into that but you may also end up creating some cloned front-ends for each user. You are right about the code being "\\SQLServer\Databases\Databases\TimeSheet2003 \Hou rs2003.mde" where you would change it to your location of your front-end mde file (which could reside on the server in the same location as your back-end - it uses the UNC name which is best (you can ask your network administrator for the UNC name)). No other changes are needed. Then just copy this vbs script to the desktop of your users (or you could also make a short-cut to the vbs script on the network drive from the user's desktop.) The only problem you might encounter is if the network administrators don't have the network drive mapped right or have the correct permissions to the network drive. Otherwise when you run the script (from the desktop or network drive) and you'll notice your source mde is still available for copying changes to it/creating a new mde and you'll see a MyApplicationLoginID.mde file with a MyApplicationLoginID.lde file present. It's a good way to also see when someone was last in the database by looking at the file creation date.

    Don't let the vbs script scare you. There are a lot of commented out commands and you'll notice that only about 4-6 lines of code are actually executed.
    Last edited by pkstormy; 09-30-06 at 02:31.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  14. #14
    Join Date
    Aug 2006
    Posts
    25

    Smile

    Hi Paul,

    Thanks for your response. I think for now I'll be satisfied if the mde format gets rid of the error message for the users. However, I'll save your script, and one day if I feel courage enough, I'll try it.

    It's funny, when I opened the "TimeSheet2003" form that you supplied, it gave me the creeps, because one time I was doing testing for upgrading this software which works with Access 2003, and when the vendor had problems with their upgraded version to work with Oracle server, that's what we have, we backed up, and I had to un-install Access 2003 and re-install Access 97 on my test machine. Access 97 interface worked fine, but everytime I ran this utilty program that we have to run once a day, it gave me the errors "Active X component can't create object" and "Library not found". At the time I didn't know about DBforum, and I seeked for help througout the company, Google, Microsoft, etc, but Whatever I did the error didn't go away. So, I ended up re-imaging my PC.

    By the way, do you know how to get rid of these types of errors in case I'll get it again?

    Thanks!
    CompPal

  15. #15
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    If you get an error like "Library not found" in MSAccess, it usually means that you don't have a reference checked (i.e marked) to that library. You can view this by going into/viewing the code (from anywhere) and then select Tools - References. The references you are currently using are the first 5,6 or so that are checked at the top of the list. If something shows that it's missing, I've found that this can cause problems with your whole application because it sometimes means that your other references aren't loading either. The activeX control is probably related to the reference that's missing which would give you the activeX error. The pain part comes in when you need to register the activeX control (3rd party)(you can goolge registering an activeX control to find more about this as I can't remember the command to do it - also keep in mind that some companies make you pay to register to use their activeX control (which is where the pain comes in - others are sometimes free but you still need to register it with the command I can't remember you would run)).

    Also, having a missing reference also happens sometimes when you upgrade from one version of MSAccess to another and usually means just finding a reference that's in the new version which matches that which would be in the old version (i.e. you might see Missing: Microsoft Access Data Components 2.0 library and if you scroll down the list, you'll see a Microsoft Access Data Components 2.1 library which you can select and you'll most often find it works ok. Make sure you uncheck the missing reference if it's checked. I've also had times when I used a third parties software where when I installed it, to use its component in MSAccess I had to select a reference to use it (where I found that reference to use either via the manual, calling the company, or looking at the list for something which had the companies name in it.)

    The reference called: Microsoft Office XP Web Components is one which has given me the most problems because for some reason, it's not always checked after I've upgraded from one version of MSAccess to a higher version (which I end up checking). Keep in mind that your references can get screwed up (going forwards or backwards) when installing different versions of MSAcess and also working with a third party reference. It also gets complicated when you're embedding excel sheets and using commands which need excel type references. You may want to read up on references (if no one's suggested that's the problem already) and how it may pertain to the error you're getting but it does sound like that's part of the problem (or the installation got messed up somehow where all of the components might not have been installed).

    If you try to run the Timesheet2003.vbs script without modifying it, you should get an error to the effect that it could not locate the Timesheet2003 application (my application for the sample.) Hope you didn't get too creeped out about it (I should clean up the example I send out). It's a good technique and I do recommend using it if you get the chance (again, you only have to change the UNC name to point to your mde file and then copy the newly saved vbs script to anyone's desktop.) You can also right-click on the vbs script and change the icon to something more pleasing. The biggest problem is just saving the script. You do a save as, then enter in the full name (i.e. MyApp.vbs) in the FileName box, and change the "Save As Type" to "All Files".

    I'm a little unclear on some of the other stuff you wrote but also keep in mind that if you have 2 versions of MSAccess on your machine (other than dealing with the references), if you import a form/report/module from one mdb to another, ALWAYS compile IMMEDIATELY after you import the objects (otherwise if you do ANY coding (without compiling), you'll trash the mdb you're working in and it won't compile). You can see a few of my posts on having 2 versions of MSAccess on the same machine and how to fix it if you do trash the mdb (you might want to try this on a sample mdb just to see what I mean if you have 2 versions - it happened to me with 2000 and XP).
    Last edited by pkstormy; 09-30-06 at 20:18.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

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