dhookom, I just solved my problem. In the BeforeUpdate code that you provided, right below Cancel = True
I added Undo.
Private Sub Code_Number_BeforeUpdate(Cancel As Integer)
If Form.NewRecord Then
If Not IsNull(DLookup("code_Number", "County_Rec", "Code_Number=" &...
Yes, I do want to reject any duplicate numbers in which the BeforeUpdate code you provided on yesterday does exactly that. With the BeforeUpdate code you provided, when I enter a number that is a duplicate, I then hit the tab button in which the message box appears, and that’s what I want...
Sorry to bother you again. The BeforeUpdate code is still working just fine. However, when the message box pops up when there’s a duplicate, if I should click the refresh button to regain access to the combo box, instead of refreshing, the duplicates message continues to appear. I use a...
Table name is County_Rec, Fields are Code_Number(don't want duplicates), Grant_Document, Mortgage_Type and Sales_Type.
The same field names are on the form.
Thanks
I have a form with some text boxes and one of them is for a Code Number (number datatype). The form also contains an Add New Record button. I’m trying to code the Code Number field to reject any duplicate numbers. Yes, I’m aware that there’s an option in the field table properties that will...
Hello, this should be my last question for a while. I have a form with some text boxes and one of them is for a Code Number (number datatype). The form also contains an Add New Record button. I’m trying to code the Code Number field to reject any duplicate numbers. Yes, I’m aware that...
Ok, I understand. In fact in one of my past projects I did put a close button on the main form to close the subform. This time around I wanted to try closing the subform with a close button on it. But, I'm beginning to see that that is probably not possible. For this project, I went ahead and...
Yes, I tried visible = false, but it didn't work. The click event for the close button on the subform doesn't include a visible or invisible option for the main form.
Ok, in the On Load even of the master form I have the subform set to visible = false and that works just fine. However, when both the master form and subform are opened, when necessary, using the closed event button, I would like to only close the subform without it also closing the master...
Hello, I’m working with a master form and subform. I have a closed button on the subform, because at times I want to only close or exit out of the subform while the master form remains opened. The problem I’m running into is that when I click the closed button on the subform, it also closes...
Darrylles, just read your last thread. Sure, I can share the code that solved my record search issue. If there's a master form containing a text box used to search a record in the subform, include the following code in the click event. That code links the Master Form to the Subform...
Darrylles,
I totally understand that the sub-form should never display sub records that are not related to Main form records, therefore the Main form and sub-form records were and are related.
I worked on the forms some more after returning to work this morning and finally got everything...
Hello Darrylles,
Yes, I have a Master form with a child sub-form. And yes, the sub-form contains many records, however when I type a contract number in the record search text-box on the master form, I only want whatever record that is associated with a particular contract number to be...
Yes, I'm working with a subform. The code I presented in my first thread on this website worked just fine with my other projects including show all records, but for whatever reason isn't working with this current one. I guess I'm a bit confused myself with what I'm trying to accomplish here. I...
Thanks dhookom,
The change you made to my code did work. However, when I type a contract number into the text box on the main form, instead of the subform displaying the one record related to the one contract number, it displays all other contract numbers along with the one typed in the text...
I’m working on a project in ms access 2007 that involves a main form and subform. The main form contains a record search textbook (txtFind) . I’m trying to search a record contained in the subform from the textbox on the main form, but keep getting the following error message: Run-time error...
I'm not using an update query, just a simple select query.
Using a one to many relationship:
ScanVariousDocs main table or the "one" table... ScanDocID is the primary key
VariousDocs is the many table.
One of you suggested that I move code from on enter button or rather commmand button and...
Ok, here's code for both the combo box and text box along with the subform fields.
Combo box code
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ScanDocID] = " & Str(Nz(Me![Combo4], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
Here are the subform fields that...
Yes, the combo box and text box which are on the main form will populate the same control on the subform or rather they will populate the same subform.
The only difference, in the combo box drop down when a particular document item is selected, the corresponding records will populate in the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.