Combining a search sub form and new entry subform

astin86

New member
Local time
Yesterday, 22:24
Joined
Aug 17, 2016
Messages
6
Hi

Im really new to access so this maybe a really stupid question.
I am currently creating a customer/Job Card data base for work.

I have set up a form which has a list box that shows details from the customer data base. This can then be filtered by a search box to find the correct customer.
When one of the lines in the list box is selected this controls a sub form which shows all the details for that customer.
However, the problem I have is that I would also like that sub box to add a new customer too.
I have created a button to do this using the wizard. However after pressing it and typing the new customers info I get this message

‘You cant assign a value to this object
*the object maybe a control on a read only form’

I can skip this message and add the customer, but after I do it doesn’t like searching for customers again. Does anyone know what I am doing wrong?

Thanks
James
 
Last edited:
How are you setting the filter on the details subform?
Is it a single record on a Single Form OR multiple records on a Single Form OR multiple records on a Continuous Form?
Have you changed any of the Data properties of the subform eg Allow Edits, Allow Additions, Data Entry etc?
 
Please tell us more about your database and the business it is intended to support.
 
Hi Isskint

The form is linked to the list (which is filtered) that like this.
Link Master Fields - [lstCustomers]
Link Child Fields - [CustomerID]
Filter on Empty Master - Yes
Enabled - Yes
Locked - No

This ends up being a single record (could this be the problem?)

Data entry is No, the rest are Yes. When I change data entry to yes, it doesn't show the info from the currently selected customer.

Hope this helps
Thanks
 
Hi J Draw

The company is a Lawnmower repair shop

The system is to be a customer data base linked to a database showing which machines they have brought in, and what needs to be fixed.

Currently I have the databases set up like this

Customer database linked to a separate job data base, lined by the auto number customer ID.

The form I am trying to create is intended to either look up an existing customer and then book in a machine to be fixed; or add a new customer then book in their machine.

thanks
 
when adding new record, you have to break the Link first, then you add the record. save the new CustomerID to a variable. after the record is saved, requery your listbox and set its value to the CustomerID that you saved earlier. reinstate the Link. the new customer is now displayed on the subform.
 
Hi arnelgp

would this be done with a VBA code on the 'new customer' button and 'Save new customer' button?

thanks
James
 
open the main form, form1.
review the code behind in form1 and the subform, customer.
 

Attachments

James,

I don't know the extent of your business nor associated requirements, but here is a link to a free, generic data model re: equipment repair that may help with tables and relationships.
It doesn't deal with data entry etc, but getting your tables structured to meet your business requirements is a critical, major step in the design of a database application.

Good luck.
 
open the main form, form1.
review the code behind in form1 and the subform, customer.

Thanks arnelgp, that worked a treat.

Also thanks for the link jdraw, i will give it a look.
 

Users who are viewing this thread

Back
Top Bottom