Help me pls =(

elvin_08

New member
Local time
Today, 15:44
Joined
Sep 12, 2011
Messages
9
i have a table PC_UNIT then i have a field RoomLocation, PCname and Availability = "available" or "not available"

then i have a borrowing form then i have a cascading combo box for the RoomLacation and PCname

my question is what if i select 1 PC name the availability of the selected PC turns to "not available"

is it possible?

Thanks in advance
 
Hi Elvin_08

It looks like an UPDATE statement is required.

If you have your PC names in a Combo or Listbox then in the AfterUpdate event you need to put something like:

Code:
CurrentDb.Execute ("UPDATE [PC_Unit] SET [Availability] = 'Not Available' WHERE [PCname] = '" & [COLOR="Navy"]me.comboPC[/COLOR] & "';")

me.comboPC will be the name if the list/combo on your form.

Hope this helps
 
Using a string to indicate 'Available' and 'Not Available' is incredibly inefficient.

Use a boolean fieldtype.
 
Hi Elvin_08

It looks like an UPDATE statement is required.

If you have your PC names in a Combo or Listbox then in the AfterUpdate event you need to put something like:

Code:
CurrentDb.Execute ("UPDATE [PC_Unit] SET [Availability] = 'Not Available' WHERE [PCname] = '" & [COLOR="Navy"]me.comboPC[/COLOR] & "';")

me.comboPC will be the name if the list/combo on your form.

Hope this helps

not working :(
 
When you say 'not working', do you mean it causes and error? or just doesn't update the record?
 
elvin, please be more descriptive when you reply. What is the error message?

You don't just say, "not working" or "having an error". Give more info so we know what the problem is quicker as we don't have much time.
 
Your whole approach to the problem is fundamentally flawed. You are recording the availability with the PC_Unit record when you should be consulting the borrowing transactions to determine availability.

If it is allocated in a borrowing transaction then it isn't avaliable. Separately recording availability is a normalization error.
 

Users who are viewing this thread

Back
Top Bottom