Are you saying get rid of my key table? If not, how do I let the dates dictate availability. Letting dates or lostKey attribute dictate availability is the core of my question, I just don't know how.
I've tried writting this query:
SELECT *
FROM keys AS a left outer JOIN keyActivity AS b
ON...
I tried this but got zero records:
SELECT *
FROM keys AS a left outer JOIN keyActivity AS b
ON a.key_id = b.key_id
WHERE return_date is not null
and lost_key =false
and id is null;
The problem is that in the keyActivities table when im selecting a key to signout, key's that have been marked as lost still show up. This is problem. I also need to do the same for keys that have not been returned yet.
This is an example of what I mean: http://jumpshare.com/v/wIDZjB?b=b7rJIn...
Hello, Im designing a key management system.
Basically I have a key table and a keyActivity table. I need a way to manage lost keys. So what I did was add a yes/no attribute called lost_key. Now I don't know how to remove from my keys table the key which was lost. From my research there is no...
I have a keys table and a keysctivity table. I need keys to not be available if they are currently signed out (return_date is null) or if they have been marked as lost (lost_key = true)
This is my activity table.
http://jumpshare.com/v/6ID9bi?b=D7NY0X
If for example signin_id 1 was not...
I have a form/subform. Im trying to set up the button code to add/update records in the subform. Add works fine but when I update it always updates the first record.
Here's my code for update:
Private Sub cmdAdd_Click()
If Me.roomName.Tag & "" = "" Then
CurrentDb.Execute "INSERT INTO...
I just put this in and it worked.
"DELETE FROM KEYS" & _
" WHERE KEY_ID=" & _
Chr(39) & Me.subKey.Form.Recordset.Fields("KEY_ID") & Chr(39)
It's basically what you said but someone at Stackoverflow said using ascii code would be safer (no idea why though)
Both methods work...
I used the debug.print stm for my delete code:
If MsgBox("Confirm Deletion?", vbYesNo) = vbYes Then
Dim strSql As String
strSql = "DELETE FROM KEYS" & _
" WHERE KEY_ID=" & Me.subKey.Form.Recordset.Fields("KEY_ID")
Debug.Print strSql ' <- prints to Immediate...
Sorry since then I've changed the drawer to number. The only text attribute is Key_ID. This is giving my delete function problems:
CurrentDb.Execute "DELETE FROM KEYS" & _
" WHERE KEY_ID=" & Me.subKey.Form.Recordset.Fields("KEY_ID")
The way it's written it is looking for a number. Im...
THere's a jump share file in the OP. I wasn't allowed to post links yet so i broke the link by removing http and adding spaces
EDIT: jumpshare. com/b/t7Lot8
Yea im not sure what's wrong. The drawer is definitely being treated as a number but im still getting data type errors when trying to update information
I removed the single quotes in the update portion of the Add button so it looks like this:
Else
CurrentDb.Execute "UPDATE KEYS " & _
" SET KEY_ID=" & Me.keyID & _
", ROOM='" & Me.roomID & "'" & _
", DRAWER=" & Me.drawerID & "" & _
" WHERE KEY_ID=" & Me.keyID.Tag
End If
But...
Im really new to VBA. This project is my first time working with it actually. I am not sure how im making the distinction between text and numeric fields.
I just realized that the attribute for drawer was text, I just changed it to numeric. How do I make sure update treats it numeric.
EDIT: I...