Link to home
Avatar of ajcostel

asked on

Access data entry continuous form containing bound and unbound controls

I work in a laboratory and would like to create a data entry form to inventory specimens. Each specimen will be stored in a freezer box. This box contains 81 positions to store unique specimens. All 81 unique specimens share common characteristics. I have created a continuous form with the following combo boxes in the header:


These Combo boxes are shared with all 81 unique specimens and are associated with unbound text boxes located in the form's detail section. In the detail section I have also created a bound textbox to record the specimen unique identifier (barcode number) and a bound combo box to select the volume present in the specimen tube. There is also an unbound textbox that populates the box position automatically/consecutively as I enter the specimen number.

Here is my problem. I cannot figure out how to append the information contained in the unbound textboxes to the table containing the information from the bound textboxes. I have tried creating a bound continuous form, but do not want to select the 8 shared characteristics for all 81 specimens. My goal is to quickly scan all 81 specimen bar codes and easily select the defining characteristics at once for all specimens.

Any help would be greatly appreciated.
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

are adding new records to the table?
Avatar of ajcostel


Yes, I am adding new records to the table.
hmm..based on your description above, the contnuous form might not be a good choice for what you trying to do. Perhaps a main form/subfoms combination will work better, but without seeing your db schema it is hard to make a suggestion that will work best.
Please find the attached stripped down version of the database. FYI...I am new to Access and learning as I go.

The two tables of interest are: 1) Molecular Freezer Inventory Mapping and 2) PHIMS/OpenELIS Clinical Specimen Numbers. These tables will be populated using the PHIMS/OE Entry Form.

Thank you for taking a look and let me know if you have any questions.
Avatar of John Tsioumpris
John Tsioumpris
Flag of Greece image

Blurred text
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Thank you for the advice John. I originally designed the form with bound controls, but I had to fill each 81 rows separately with the same information. I appreciate the suggestion of using concatenated fields, but I do not know how to get this to work with my individual combo boxes.
Can you give me an example of your workflow....probably you need a redesign
I think you may be right about the redesign. I have attached a stripped down version of the database in a previous post to Rey. I created two main tables to record freezer boxes. 1) Molecular Freezer Inventory Mapping. This table contains the following fields: Designation, BoxID, Year, Analyte, SpecimenMatrix, SpecimenResult, TechInitials, LotNumber, RUO, Freezer, Shelf, Rack, Box and Comments. It is used to track all box types (Designations). 2) PHIMS/OpenELIS Clinical Specimen Numbers. This table supplements the main table with an inventory of the box contents. The fields associated with this table are the following: PHIMS_OpenELISNo, MatrixVolume, Freezer, Shelf, Rack, Box and BoxPosition. The following fields are used to link the two tables together: Freezer, Shelf, Rack and Box. In hindsight I probably should have used a single field, BoxID, to link the two tables which would be unique.

My goal is to take a box from the freezer and scan the contents via barcodes. There are 81 individual tubes that share the same information: Designation, BoxID, Year, Analyte, SpecimenMatrix, Freezer, Shelf, Rack, Box. The fields that are unique are: PHIMS_OpenELISNo, MatrixVolume and BoxPosition. Ideally, I would like to select these specifics once for all the box contents and just scan in the barcodes. I even have the BoxPosition calculated with the creation of a new entry.

I hope this is not too confusing to follow, and helps you better understand my particular needs for the database.

Many thanks!
I forgot to mention one important detail. This form is for data entry. I would like to see an empty form every time I open it.

Thank you!
The empty form is easy just set the form to Data Entry --> Yes (Properties/Data tab)
As for the redesign maybe you could substitute the "static" fields to a single number :
  Designation, BoxID, Year, Analyte, SpecimenMatrix, Freezer, Shelf, Rack, Box. --> No xxx
This is what I have done thus far:

1) Added a new field, BoxID, to PHIMS/OpenELIS Clinical Specimen Numbers Table.
2) I deleted the old relationships (freezer, shelf, rack and box) between the parent table, Molecular Freezer Inventory Mapping, and PHIMS/OpenELIS Clinical Specimen Numbers and created a single relationship, BoxID.
3) Created a new bound form with the following controls in the detail section: Designation, Year, Analyte, SpecimenMatrix, Freezer, Shelf, Rack, Box and BoxID. All of these controls, with the exception of BoxID, derive from the parent table. BoxID is from the PHIMS/OpenELIS Clinical Specimen Numbers table.
4) I added a continuous subform displaying the following controls from the the PHIMS/OpenELIS Clinical Specimen Numbers table: BoxPosition, PHIMS_OpenELISNo and MatrixVolume.

I believe everything is working. The tables are populating correctly. My problem now relates to the BoxPosition control automatically populating with each new entry. This number will always start at 1 and may or may not always end at 81. Do you have any ideas?

Thank you!
If this is the issue then you could run an append query to populate all the unused Boxes...if i misunderstood then a new sample i guess is needed
Please find that attached database. My new data entry form is "Test." In the subform I would like to have the BoxPosition control  to automatically and serially populate from 1. Please let me know if you have any questions.

Thank you.
In order to have this sequential BoxPosition you could use this code :
BoxPosition = Dmax(Nz("BoxPosition","PHIMS/OpenELIS Clinical Specimen Numbers","BoxID = " & Me.Parent.BoxID),0))+1

Open in new window

Hello John!

Thank you for your help. I do have a couple of questions for you regarding the above mentioned code. I added it to the control source and when in form view see, "#Name?". I also see the following messages when in design view, "Invalid Control Property:Control Source" and "Expressions must begin with an equal sign (=)." I checked the code again and Access altered it to read, "[BoxPosition = Dmax(Nz("BoxPosition","PHIMS/OpenELIS Clinical Specimen Numbers","BoxID = " & Me].Parent".

What are your thoughts? I also tried adding it to Before/After Update with little success.

Thank you
The above code is for VBA.....right now i can't check your sample but i think you use an "Add" button so on the Click_Event you will insert the above snippet.....
I added a button to the header of my subform and added the snippet of code to the "on click" event. When I clicked on the button I received the following VBA complie error, "Wrong number of arguments or invalid property assignment." It also highlighted "Nz" in the code.

Here is what I have type in VBA:

Private Sub CommandAddBoxPositions_Click()
BoxPosition = DMax(Nz("BoxPosition", "PHIMS/OpenELIS Clinical Specimen Numbers", "BoxID = " & Me.Parent.BoxID), 0) + 1
End Sub

It is actually only three lines in total. The code is all on one line.
Yes i see the error wrong....
BoxPosition = Nz(DMax("BoxPosition", "PHIMS/OpenELIS Clinical Specimen Numbers", "BoxID = " & Me.BoxID), 0) + 1

Open in new window

This is the new code:
Private Sub CommandAddBoxPositions_Click()
BoxPosition = Nz(DMax("BoxPosition", "PHIMS/OpenELIS Clinical Specimen Numbers", "BoxID = " & Me.BoxID), 0) + 1
End Sub

But now I get the following error:

Run-time error '3075':
Syntax error (missing operator) in query expression 'BoxID = Bacterial Extracted Specimens (BP/CP/LP/MP) (-)'.

This happens to be what I selected from the drop down box located in the main form detail section. Maybe there is an issue with my form design, but everything was working correctly.

Thank you
A minor change since the value is alphanumeric
BoxPosition = Nz(DMax("BoxPosition", "PHIMS/OpenELIS Clinical Specimen Numbers", "BoxID = '" & Me.BoxID &"'"), 0) + 1

Open in new window

There is a single quote ' when the criteria are alphanumeric
The box position controls for all records in the subform fill in with "1" when I click the command button. Also, these values are not appending to the PHIMS/OpenELIS Clinical Specimen Numbers Table.
I just realized that my BoxPosition control was unbound. It is now corrected. After scanning in my barcodes and clicking the button the only BoxPosition control to populate with "1" is the record in focus. I hope this helps troubleshooting.

Thank you very much for your time!
Hello again John.

Please see the following link:
This is what I would like to happen, but don't know how to append the data to the table.

Thank you very much,
its a slow process...i have tried it in the past but i can't remember how many records where involved....on the other hand if this is what you want it works
I appreciate your time in troubleshooting this aspect of my form. The code works, but it does not append to the table. Do you think I should create a new question specific to this problem?

Thank you again!
If my memory serves me right the code shows only visual representation....
I must be honest with have an interesting project but in order to get it done it needs some works which in my opinion cannot be covered by a Q&A site...
If it was my project to undertake i would need a clear workflow description...possible a diagram that shows what it needs to be done and in what order...
I will do my best to provide you with description of workflow. Will get back to you soon. Thank you!
Hello again John,

Please see the attached word doc. I hope this helps explain my situation. Please let me know if I misunderstood your previous question.

Thank you much,
Work-Flow.docx i see...let me think about it...but probably it will take some time because this week is pressing...
No worries John! I can't thank you enough for helping me! Take care and will speak with you soon.

Please find attached a new and improved database design. I have addressed some data relationship issues and removed any "spaces" and/or "special characters" from table and column names.

The new form we have been working with is titled, "InventoryMapping," and the respective subform is titled, "SpecimenNumbers subform."

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.