Hi
Although I do quite a bit in VB6 and VBA in Excel, Access has always been harder for me to grasp so I'm here as a newbie looking for some help!
I have a form which I would like to use a drop-down list of players in a football team. On selection, the form should populate a few text boxes and then buttons on the form are used to generate pdfs, etc of information about the player.
This all works great but i find that when i look at my data, players are having their data overwritten with other players info! I assume this is because it is being updated when i select a new player.
I tried playing with the allow edit, allow addition etc parameters for the form but then reached a point where nothing happened on the dropdown event.
The event actually triggers some VBA (which may actually be the wrong thing to do but given my background that where i headed!).
Ultimately I would like to be able to change the data via the form but maybe only by changing the data and then clicking a save button. By default i want this to act more as a read-only form.
I hope my ramblings make sense. Many thanks in advance
Although I do quite a bit in VB6 and VBA in Excel, Access has always been harder for me to grasp so I'm here as a newbie looking for some help!
I have a form which I would like to use a drop-down list of players in a football team. On selection, the form should populate a few text boxes and then buttons on the form are used to generate pdfs, etc of information about the player.
This all works great but i find that when i look at my data, players are having their data overwritten with other players info! I assume this is because it is being updated when i select a new player.
I tried playing with the allow edit, allow addition etc parameters for the form but then reached a point where nothing happened on the dropdown event.
The event actually triggers some VBA (which may actually be the wrong thing to do but given my background that where i headed!).
Code:
Me.PlayerName = DLookup("PlayerName", "ActivePlayers", "ActivePlayers.PlayerName=""" & Me.Player.Value & """")
Me.DOB = DLookup("DOB", "ActivePlayers", "ActivePlayers.PlayerName=""" & Me.Player.Value & """")
Me.Address = DLookup("Address", "ActivePlayers", "ActivePlayers.PlayerName=""" & Me.Player.Value & """")
Me.School = DLookup("School", "ActivePlayers", "ActivePlayers.PlayerName=""" & Me.Player.Value & """")
Me.Parent1Name = DLookup("Parent1Name", "ActivePlayers", "ActivePlayers.PlayerName=""" & Me.Player.Value & """")
Me.Parent1Email = DLookup("Parent1Email", "ActivePlayers", "ActivePlayers.PlayerName=""" & Me.Player.Value & """")
Me.Parent1Phone = DLookup("Parent1Phone", "ActivePlayers", "ActivePlayers.PlayerName=""" & Me.Player.Value & """")
Me.Parent2Name = DLookup("Parent2Name", "ActivePlayers", "ActivePlayers.PlayerName=""" & Me.Player.Value & """")
Me.Parent2Email = DLookup("Parent2Email", "ActivePlayers", "ActivePlayers.PlayerName=""" & Me.Player.Value & """")
Me.Parent2Phone = DLookup("Parent2Phone", "ActivePlayers", "ActivePlayers.PlayerName=""" & Me.Player.Value & """")
'Me.Photo.Picture = DLookup("Photo", "ActivePlayers", "ActivePlayers.PlayerName='" & Me.Player.Value & "'")
Me.Whatsapp = DLookup("WhatsappGroup", "ActivePlayers", "ActivePlayers.PlayerName=""" & Me.Player.Value & """")
Ultimately I would like to be able to change the data via the form but maybe only by changing the data and then clicking a save button. By default i want this to act more as a read-only form.
I hope my ramblings make sense. Many thanks in advance