Search results

  1. S

    Disable a record from a table based on the attribute of another table

    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...
  2. S

    Question Handling lost inventory

    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;
  3. S

    Disable a record from a table based on the attribute of another table

    Im sorry, I didn't get that at all.
  4. S

    Question Handling lost inventory

    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...
  5. S

    Question Handling lost inventory

    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...
  6. S

    Disable a record from a table based on the attribute of another table

    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...
  7. S

    Updating Records in Access Subform

    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...
  8. S

    Add/Edit Button Giving Datatype Error

    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...
  9. S

    Add/Edit Button Giving Datatype Error

    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...
  10. S

    Add/Edit Button Giving Datatype Error

    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...
  11. S

    Add/Edit Button Giving Datatype Error

    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
  12. S

    Add/Edit Button Giving Datatype Error

    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
  13. S

    Add/Edit Button Giving Datatype Error

    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...
  14. S

    Add/Edit Button Giving Datatype Error

    My god, VBA is tricky. Ill try it right now and see if this works. Thanks for the replies.
  15. S

    Add/Edit Button Giving Datatype Error

    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...
  16. S

    Add/Edit Button Giving Datatype Error

    I have a main and subform. I have text boxes in the main form that will allow me to add/edit information into the subform. Add works fine but when I try to edit a record, the information of the selected record shows up in the textbox like I want to but when I try to update, I get datatype error...
Back
Top Bottom