Search results

  1. M

    Keep form from closing

    Thanks! That did it.
  2. M

    Keep form from closing

    Isn't that what I have already...with the cancel=true? The form still closes. I have now tried this: Private Sub SaveAndClose_Click() On Error GoTo SaveErr DoCmd.Save DoCmd.Close acForm, "Case", acSaveNo Select Case Outcome Case "Interpretation" If IsNull([Date Provided]) Or...
  3. M

    Keep form from closing

    I have a form that has some fields with validation rules, which are Not Is Null. I have a private function to validate records (here is a snipet) Private Function ValidateRecord() As Boolean ValidateRecord = False Select Case Outcome Case "Interpretation" If IsNull(Me.[Date...
  4. M

    Form_BeforeUpdate(Cancel As Integer)

    Thanks for the reply. I tried it and it didn't work :( The msgbox still pops up after having the combo filled. Edit: It seems like my project is borked as I deleted the entire code for the combo and the project still acted as if the code was there and kept giving the msgbox message. Anyways, I...
  5. M

    Form_BeforeUpdate(Cancel As Integer)

    Hello, I have this code If IsNull(Me.Providers) Then Cancel = True MsgBox "Enter a Provider!" End If in the beforeupdate event. I don't think it is working properly because it is a combo box, as I have the exact same code for a textbox that works fine. Even if I choose a name from...
  6. M

    change required property in vba

    I figured it out. I was looking at the macro for my button and came across the SetProperty... So in a round about way, Burrina, you helped me out, so thanks!
  7. M

    change required property in vba

    I do have a button, but it is a Macro. So I should convert it to vb and then do a lot of If...Then? That seems like a lot. To get an idea of my form, the top half has around 9 controls whose fields are set to required in the table. These fields are like an intake, they have the client's...
  8. M

    change required property in vba

    Hello, I have a form that has some controls whose properties are already listed as required in the table. However, it also has a combo box labeled "Outcome" that changes what textboxes are enabled depending on what is chosen in that combobox. What I would like to do, is make sure that whatever...
  9. M

    recordset error

    Ahh, okay. I normally do indent everything, but I was just trying the inserted recordset code this morning and so didn't want to indent everything if I was just going to have to pull the code out. I have been having so many issues with getting this button to do what I want. You should be glad I...
  10. M

    recordset error

    Thanks for your response! I thought tab-key did indent...what do you mean please?
  11. M

    recordset error

    I wanted it to find the record in which the First Name, Last Name, and DOB fields in the table are identical to what the user typed in the First Name, Last Name and DOB textboxs on the form. Is that not possible? Sorry, this is my first time trying to do a recordset.
  12. M

    recordset error

    I am trying to add a recordset to my button to see if a client exists. A client exists in the table Clients if all three fields (First Name, Last Name and DOB) are identical to what the user is typing into the text boxes (named the same) to add a client. My recordset comes up with the error...
  13. M

    form button and error handling

    So I now have this code Private Sub AddNewClient_Click() On Error GoTo AddNewErr If Me.First_Name <> "" And Me.Last_Name <> "" And Me.DOB <> "" Then Dim ClName As Variant Dim ClientID As Integer ClientID = Me.Client_ID.Value ClName = Me.Client_Name.Value DoCmd.Close acForm, "Client", acSaveYes...
  14. M

    form button and error handling

    Hello, I have a few questions that tie in together. I have a Main form, that when I click a button, a new Client form opens. On the Client form, I have 3 text boxes that users use to create a new client, first name, last name, and date of birth. I also have 2 invisible text boxes named Client...
  15. M

    Filter listbox via 2 text boxes

    Ok, so after much research on the Chr(34), I got the WHERE code to work, I believe ClientSearchQry = ClientSearchQry & " WHERE (Clients.[First Name] Like '" & Me.[First Name] & "*' AND Clients.[Last Name] Like " & Chr(34) & Me.[Last Name] & "*" & Chr(34) & ")" with the immediate window for ...
  16. M

    Filter listbox via 2 text boxes

    I still can't seem to make it work and now it doesn't filter at all :( I tried two different ways Option A: Option Compare Database Option Explicit Dim ClientSearchQry As String Private Sub UpdateListbox() ClientSearchQry = "SELECT Clients.[Client ID], Clients.[First Name], Clients.[Last...
  17. M

    Filter listbox via 2 text boxes

    Thanks Doc and Cronk for responding. Sorry for being slow, but I'm still a bit confused. Cronk, it seems like you are saying something a bit different from Doc in that my second coding that I tried was doing what you said except maybe my If statements were a bit off. Doc, I get most of what...
  18. M

    Filter listbox via 2 text boxes

    my listbox, titled ClientList, has rowsource as: [SELECT [Clients].[Client ID], [Clients].[First Name], [Clients].[Last Name], [Clients].[DOB], [Clients].[Client Name] FROM Clients ORDER BY [First Name], [Last Name], [DOB]; then for the first textbox on change event that searches the First...
  19. M

    Filter listbox via 2 text boxes

    Hello, I am really new to Access, so I don't know much about coding except what I have read in a coding for dummies book ;D I have also tried to google this but can't get what I have found to work. I have a listbox where the rowsource is a SQL statement. I didn't know if I should try that or...
  20. M

    Please Help with Coding!

    Hi, Thanks. I will read over that information. I have actually done a ton of reading, doing as many tutorials as I can find and also finding a Coding for Dummies online book. I realize my knowledge is very little as I just started last week, but my work place needs this project in place ASAP and...
Top Bottom