Inserting data into a table (1 Viewer)

simon4amiee

Registered User.
Local time
Today, 00:38
Joined
Jan 3, 2007
Messages
109
morning all,

In just about to create a form in Access 2010. Its very simple and has around 10 fields.

What I didn't want to do is base the form on the main table (eg I dont need to see the other records.

All I need is a form to input my data, and then click a button to then insert into the main table and reset the form.

Is this possible? Is this the best way to go?


Originally we used code to insert the data but this is manual in that I had to alter the code every time to reflect the answers. I was asked to create a simple form (using drop downs etc) which would essentially do the same.


This is the orginal code. This table is now linked into an Access 2010 database.

Code:
INSERT INTO [CommDB].[dbo].[tblLocalClinicExtension]
(
		ImpCode,
		Hospital,
		ClinType,
		Clinic,
		Purchasable,
		SendToSUS,
		SLAMSpecialty,
		Anonymise,
		Comment,
		SUSEffectiveFrom,
		SUSEffectiveTo,
		PurchEffectiveFrom,
		PurchEffectiveTo,
		HomeVisit,
		ProvCode,
		FuncClinic,
		DiagnosticClinic,
		AntenatalBK,
		OPComm,
		CysticFibrosis,
		ClinicSpecialty,
		OriginalClinicCode,
		IsTelephoneClinic,
		VirtualClinic,
		AHPClinic
)

VALUES
(
		'HEY',		-- ImpCode				-- Always 'HEY'
		'',			-- Hospital				-- Code for clinic location, often located from clinic description. Current values; ABH,BDH,BIRK,BUPA,BWH,CHH,CHWH,HCH,HMH,HRI,HRWH,KGH,NUFF,PRH,SGH,WAC (with HRI and CHH the most common)		
		'CLI',		-- ClinType				-- Always 'CLI'
		'',			-- Clinic				-- The clinic code
		'',			-- Purchasable			-- '1' If the clinic will be charged for i.e. normal, '0' if non chargeable i.e. test clinic
		'',			-- SendToSUS			-- '1' If the clinic will be sent to SUS i.e. normal, '0' if not sending to SUS i.e. test clinic
		NULL,		-- SLAMSpecialty		-- National specialty code (if known), otherwise NULL (normally the case)
		'',			-- Anonymise			-- '1' If the clinic is of a sensitive nature and patients should not be identified i.e. H.I.V., '0' if not (normally the case)
		'',			-- Comment				-- Should always be populated with initials of staff adding clinic, date clinic added to table and clinic information provided by (i.e. who replied to the email)
		NULL,		-- SUSEffectiveFrom		-- Date if only SUS effective between certain dates (rare), NULL if not (normally the case)
		NULL,		-- SUSEffectiveTo		-- Date if only SUS effective between certain dates (rare), NULL if not (normally the case)
		NULL,		-- PurchEffectiveFrom	-- Date if only chargeable between certain dates (rare), NULL if not (normally the case)
		NULL,		-- PurchEffectiveTo		-- Date if only chargeable between certain dates (rare), NULL if not (normally the case)
		'',			-- HomeVisit			-- '1' If the clinic is activity where staff go to patient's homes, '0' if not. Sometimes located from clinic description, but should be identified in email response from clinic creator
		'RWA',		-- ProvCode				-- National provider code, nearly always 'RWA', but could also be 'RR8' (Leeds?) or 'RV9' (Humber - Mental Health) if technically their activity
		'',			-- FuncClinic			-- Will predominantly be 'OPD' (normal) or 'PREO' (preassessment clinic, from clinic description) but could be another, values based on old INFOCOM local field. Vital for therapies / AHP flagged clinics (In which case must be; PHYS,OCCT,ORTH,DIET,SPEE) Current values; NULL,,ADV,AE,BACK,BLDS,CAT,CLIN,DIET,ENDO,EPS,FAMH,GLAU,HAHT,HAND,HMTR,LASE,OCCT,OPD,ORTH,PCT,PHYS,PREC,PREO,SNOR,SPEE,XLAC,XMDT,XOBS
		'',			-- DiagnosticClinic		-- '1' If the clinic is purely diagnostics activity, '0' if not. Should be identified in email response from clinic creator
		'',			-- AntenatalBK			-- '1' If the clinic is used as the start of the maternity pathway (i.e. sees women for their first pregnancy appointments), '0' if not. Should be identified in email response from clinic creator
		'',			-- OPComm				-- '1' If the clinic is outpatient activity done out in the community, '0' if not. Should be identified in email response from clinic creator
		'',			-- CysticFibrosis		-- '1' If the clinic is purely for cystic fibrosis patients (therefore should be specialist commissioned), '0' if not. Should be identified in email response from clinic creator
		NULL,		-- ClinicSpecialty		-- National treatment specialty code if known, NULL if not
		'',			-- OriginalClinicCode	-- The clinic code, again
		'',			-- IsTelephoneClinic	-- '1' If the clinic is purely for telephone contacts (should be put in the clinic description), '0' if not. Should be identified in email response from clinic creator
		'',			-- VirtualClinic		-- '1' If the clinic is a virtual clinic (conversations between consultants and GPs - patients just discussed and not actually seen, I think?), '0' if not. Should be identified in email response from clinic creator
		''			-- AHPClinic			-- '1' If the clinic is purely for allied health professionals (i.e. therapies activity), '0' if not. Should be identified in email response from clinic creator
);
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 00:38
Joined
Jul 9, 2003
Messages
16,285
The easiest way would be to use the form wizard to create a form based on the table and then delete the controls that link to the fields you don't want to see.
 

mikejaytlabustro

Access Database 2007 PH
Local time
Today, 07:38
Joined
Feb 11, 2013
Messages
93
Create a form with a Record Source from your Table, set the default view to "Single Form" and Data Entry to "Yes" in form properties.
 

Alvarogue

Registered User.
Local time
Yesterday, 16:38
Joined
Jan 3, 2016
Messages
40
Would this work if you use a Single form and use a search combo box on it?
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 00:38
Joined
Jul 9, 2003
Messages
16,285
Alvarogue, you will be better off posting a new question in a new thread.
 

Users who are viewing this thread

Top Bottom