needhelplol
Programmer
i don't know if this is possible in vba,
to help here's a bit of background, i'm trying to creating an access replacement for a paper based log, so to speak, for a restaurant,
i have a few tables, forms some with sub forms and some querys.
one sub form has checkboxes to represent tables (based on the seating plan) each booking is linked to a table or more hence tick boxes, i want to be able to see if a table is all ready being used before it is allowed to be selected,
my problem is, i normally use php and mysql, where i could do
on clicking on check box (set as varible $box = table number) run query etc.
then if results found:- error table is in use
in my vba
in the query - 'qbooking',
booking_id, date, then tables 1->37,
123, 02-02-08, yes, (all other tables 2->37 =null)
in text14 it gives the value of box (this case '1') not the 'yes' i was hoping for, i'm using a query instead of using a sql query statement, thinking it would be easier...
if it is not possible, this there a way i could do this with a bit of reorganizing?
thank you for any response and for the time to read (long winded i know)
to help here's a bit of background, i'm trying to creating an access replacement for a paper based log, so to speak, for a restaurant,
i have a few tables, forms some with sub forms and some querys.
one sub form has checkboxes to represent tables (based on the seating plan) each booking is linked to a table or more hence tick boxes, i want to be able to see if a table is all ready being used before it is allowed to be selected,
my problem is, i normally use php and mysql, where i could do
on clicking on check box (set as varible $box = table number) run query etc.
Code:
mysql_query("SELECT $box FROM tables WHERE ($box = 'yes')");
in my vba
Code:
private sub ctr1_onclick()
tcheck(1)
(more code to do with seats etc.)
end sub
public sub tcheck(box)
check = DLookup(box, "qbooking", "yes")
Text14.Value = Text14.Value + check 'error checking
If check = Null Then
MsgBox ("OK") 'error checking
Else
MsgBox ("This table is in use")
End If
End Sub
booking_id, date, then tables 1->37,
123, 02-02-08, yes, (all other tables 2->37 =null)
in text14 it gives the value of box (this case '1') not the 'yes' i was hoping for, i'm using a query instead of using a sql query statement, thinking it would be easier...
if it is not possible, this there a way i could do this with a bit of reorganizing?
thank you for any response and for the time to read (long winded i know)