Hey guys,
Been wrapping my head around this for days but can't seem to get it right.
I have a database where i only want one admin to be able to use it at a time, so when an admin open this database it should do a check in the settings table, if it says yes in the answer field it should give a messagebox saying that there is already an admin using the database and then quit. If it says No then it should open the query "UpdateAdminUseToYes" (this changes the No into a Yes) and close this table and open the form Admin_frm.
I know there is something wrong with my code, cause im nowhere near to having experience in access... Hereunder the code tried to use (btw the settings table is a linked table if that matters)
Thanks for helping me out guysCode:Dim varx As Variant If (DLookup("[answer]", "settings", "Yes")) Then MsgBox ("There is already an admin working in this database!") DoCmd.Quit Else DoCmd.OpenQuery "UpdateAdminUseToYes" Docmd.close "Bypass_frm" Docmd.open "Admin_frm" End If