Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389


    Quote Originally Posted by Bob Fitz View Post
    Post a copy of the db to illustrate that. I just the following three lines and then the arrow keys seemed to work as required

    DoCmd.OpenForm Me.List74.Value
    Me.butadd.SetFocus
    Me.List74.Visible = False
    You are right but here alt+M sometimes works and sometimes not, I don't understand why this is happening.

  2. #17
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Try this:
    create a module level integer variable (e.g. intKey)
    turn the setfocus line back on for the listbox
    for this control, add keyup and keydown events. To each, add
    If KeyCode = 38 Or KeyCode = 40 Then intKey = KeyCode

    in list click event do
    Code:
    If Not (intKey = 38 Or intKey = 40) Then
        DoCmd.OpenForm Me.List74.Value
        Me.butadd.SetFocus
        Me.List74.Visible = False
    End If
    intKey = 0
    As it is, you have a less than intuitive thing going on here. When add button is moused over the listbox opens and an item is highlighted. That implies that the arrow keys will then work - but they won't because to make that happen, you actually have to click on the add button because the listbox does not have the focus until then. IMO that's not good.

    Your eagerness to do complicated things is admirable but honestly, your skills and knowledge are not at the same level. You also seem destined to make the same mistakes over and over, and often fail to implement good advice you are given wherever possible (you haves still have modules without Option Explicit). You claim to google things and not find them and yet when we don't know the answer and google stuff we find it right away. Why is that? If you did this maybe you would have found that making a selection in an unbound list box (that's what the arrow key is doing in your code) the listbox click event fires. I did not know that but it took only 3 minutes of searching to learn it. Your db's are difficult to troubleshoot because you do things like make forms modal, disable close buttons (I cannot close any of the forms opened by this listbox unless I right click) and don't repeat instructions. Perhaps you expect us to know what to do when something happens or maybe we have to review the thread again to figure it out. That all adds to the drudgery of troubleshooting your work and I don't know how much more I can put up with that.

    Gotta run.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #18
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by Micron View Post
    Try this:
    create a module level integer variable (e.g. intKey)
    hello micron
    Thank you for replying,
    Whenever you come to my post you definitely scold me. But I don't feel bad because I know medicine is always bitter.

    1. As you said close button is disabled in all forms actually I had deleted the coding of all forms as my main purpose was from dashboard I have again enabled close button in all forms.

    2. As you might suspect, I don't Google anything. It is not so, Micron, I not only Google but also search a lot on YouTube. Actually, I am Indian and I understand Hindi language very well and all the articles on Google are in English language, so I first read them through Google Translate. One has to understand by converting it into Hindi.Many times, even the English videos on YouTube have to be understood by turning on Hindi captions. It is possible that due to language errors, I am not able to get accurate answers to my questions.

    3. I have made changes in the code as per your suggestion but still my problem has not been solved.
    (a) Actually, by pressing Alt + M sometimes the list box is shown and sometimes it is not shown.
    (b) Drop down selection in list box is still not working.

    4. One more thing, thank you very much for giving me so much time and writing such an article for me and explaining it in detail.
    Attached Files Attached Files

  4. #19
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    I sent you a pm as it seems more appropriate than posting.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. How to creat a report as in the picture?
    By Nguyendunganh in forum Reports
    Replies: 0
    Last Post: 05-29-2018, 03:04 AM
  2. Creat a Summary Report
    By Karenclaire in forum Reports
    Replies: 3
    Last Post: 04-23-2013, 06:27 AM
  3. Can't creat pivot table
    By jmhultin in forum Access
    Replies: 3
    Last Post: 03-11-2013, 03:08 PM
  4. How to creat an window for Username and password?
    By YaseenIskaf in forum Programming
    Replies: 2
    Last Post: 02-07-2013, 07:31 AM
  5. how to creat purchase order
    By arctushar@yahoo.com in forum Access
    Replies: 5
    Last Post: 10-07-2010, 08:14 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