AccessSweeper: Uncover the Fun!

murray83

Games Collector
Local time
Today, 18:37
Joined
Mar 31, 2017
Messages
840
AccessSweeper: Uncover the Fun!


Back again, making DB's not dull and boring. My target this time was Minesweeper so please...

Dive into the captivating world of AccessSweeper, the ultimate twist on the classic Minesweeper game, now designed for Microsoft Access! Challenge your mind and reflexes as you navigate through a grid filled with hidden treasures and potential pitfalls.

Game Features:

  • Three Exciting Levels: Choose your challenge with Easy, Medium, and Hard modes, each offering a unique grid size and complexity to keep you engaged.
  • Intuitive Gameplay: Use your mouse to click and reveal tiles, uncovering numbers that indicate the proximity of hidden mines. Strategically deduce safe spots and avoid explosive surprises!
  • User-Friendly Interface: Designed with accessibility in mind, AccessSweeper is easy to navigate, making it perfect for players of all ages and skill levels.
Get ready to think critically, strategize, and have a blast with AccessSweeper! Will you uncover the secrets of the grid, or will you fall victim to the mines? The adventure awaits!

FYI there is a counter and an end goal but as yet not capturing anything

enjoy and as always welcome to feedback good and bad

:)
 

Attachments

It does

What you mean ?
 
1750610619940.png
 
first time seen that issue crop up and in regard to the mouse down yeah but then i just had duckduckgo AI chat repeat them for txt_5_n so on on up to the txt_10_n

and ill check yours out, cheers
The benefit of Tom's method, is if you have to update the events, you do it once in the class, not as many times as you have textboxes.
I am a little confused as to why you use loops in some places and hardcode in others?

@tvanstiphout I was trying to do something like you have done in another thread, but got lost on the collection code.
Why is there no collection for your class, despite multiple controls? :unsure:
 
I was trying to do something like you have done in another thread, but got lost on the collection code.
Why is there no collection for your class, despite multiple controls?
IMO if you really may want a collection class when you need to do a lot of management of all the objects or you want the class to raise events and you trap the events. That is a more work but gives you more flexibility. Probably overkill here.

I describe that here.

This way you can make the class more agnostic and decoupled. You do not put the processing of the form in the class and your not referencing the properties of the parent form. You are simply trapping events and then having a centralized mean to echo these events.

In @tvanstiphout class only works with a specific parent form with specific properties and events procedures. So this works well and is quick and easy. But it is tightly coupled and not very flexible to be used universally. It works with this form but could not be used with all forms that you want to manage the mouse down event. Here you see the need to couple to the parent form.
Code:
If Button = 2 Then ' Right mouse button
        m_txt.Parent.ToggleFlag m_intRow, m_intCol
    Else
        m_txt.Parent.txtCell_Click ' Call the existing click event for left-click
    End If

If I wanted to make it more universal I would add all my objects to my custom collection class, and have the collection class raise a custom event when any of the objects receive a mouse down. Then the custom event can echo the txt box object, button, shift x, y. Now any form can process that single event and use the custom collection class as the universal "messenger". But again probably overkill for this.
 
Yes, mine was doing the same thing, purely for that example to reduce all those individual click events.
That was all I was trying to accomplish.
Code:
Option Compare Database
Option Explicit
'
Private WithEvents mCmd As CommandButton
Private Const mcstrEvProc As String = "[Event Procedure]"
'
Private Const cstrAlphabet As String = "#ABCDEFGHIJKLMNOPQRSTUVWXYZ"

Public Function Init(lCmd As CommandButton, iAlpha As Integer)
    Set mCmd = lCmd
    mCmd.Caption = Mid(cstrAlphabet, iAlpha, 1)
    mCmd.OnClick = mcstrEvProc
End Function

Private Sub Class_Terminate()
    Set mCmd = Nothing
End Sub
Private Sub mCmd_Click()
    LocateRecord (mCmd.Caption)
End Sub

Private Sub LocateRecord(strCaption As String)
    Dim i As Integer, strAin As String
    'Debug.Print Screen.ActiveControl.ControlType
    
    DoCmd.RunCommand acCmdSaveRecord
    mCmd.Parent.RecordsetClone.FindFirst "[AAC] = '" & strCaption & "'"
    mCmd.Parent.Bookmark = mCmd.Parent.RecordsetClone.Bookmark
    strAin = mCmd.Parent.RecordsetClone.Fields("AIN")
    
    mCmd.Parent.NavMenu = mCmd.Parent.NavMenu.ItemData(strAin) 'RecordsetClone![AIN]
    'Debug.Print strCaption & " - " & mCmd.Parent.NavMenu.ItemData(strAin) & " - " & strAin

End Sub
 

Users who are viewing this thread

Back
Top Bottom