Help - Forms Opening Other Forms With Same Primary Key ID ??
Apr 12, 2005
Hi there
I hope you can help me
I am building an access database that has a section that is acting like an enrolment form. I have seperate tables that represent seperate entities but would all be part of the same enrolment page. For example, when i have a new person i open the databse where i have one form for entering the persons name and address etc, then ideally i want to click on a button to save that form/table and go to another (to input details on their goods, then another for another purpose)
What i am having difficulty is finding out how to do this. I am an amateur with Access and although i have used VB before im by no means an expert.
I set up my form with a control button which id like the user to be able to click which would then save all of the name/address information and move onto the next screen to input that persons goods. This should be based on the persons ID number, so if my next new customer has an autoID of 332, after adding their personal details and clicking the next button the goods form is opened with 'customerID of 332' already present.
It would also be good if there was a way of doing this that didnt look like seperate forms opening but one continuous flow ... if thats possible?
How do i do this?
If anybody knows, and can tell me as simply as possible i will be eternally greatful
Thanks
:)
View Replies
ADVERTISEMENT
Apr 7, 2014
I have a Form opening from Access Options. I would like to close this Form using the Timer. The following is the code I have used but it is not working.
Private Sub Cover_Page_Form_Load()
OpenTimer = Timer
End Sub
Private Sub Cover_Page_Form_Timer()
If (Timer - OpenTime) = 5 Then DoCmd.Close acForm, "Cover_Page_Form", acSaveYes
End Sub
Next question. If I can get this to work can I then use a DoCmd to open new Form within the code above or do I need a new process.
View 5 Replies
View Related
Apr 20, 2006
Hi All,
Is there a way that when the user clicks on a database file, the form pops up without opening MS Access window.
Thx,
Jatz
View 1 Replies
View Related
Apr 20, 2006
Hi All,
Is there a way that when the user clicks on a database file, the form pops up without opening MS Access window.
Thx,
Jatz
View 6 Replies
View Related
Nov 5, 2013
I'm trying to get a combo box & button to work together. On the main form of the attached database, I just want the button to go to the associated record based off my selection (or entry) in the combo box.
I've tried the following:
- Looked through the Northwind sample database for a close example. Tried my best to replicate the functions but it didn't work
- Looked through other examples posted and tried to manipulate the code to no avail
- Tried using [Forms]![Main Form]![cmbLastName] in both the filter & criteria section of the macro
View 4 Replies
View Related
Aug 7, 2014
the forms are not opening in modal/dialog mode when they should be.The forms' pop-up and modal properties are set to "yes"..The code specifies to open Dialog so, for example:
Code:
DoCmd.OpenForm "frmCompanies", , , , , acDialog
Yet, the form opens behind the other form (which, incidentally, is also set to be pop up and modal in the form properties--is that the problem? If so, why wasn't this an issue until now?).
View 14 Replies
View Related
Mar 8, 2013
I have a main form with multiple subforms in tab view, right now the forms only open in edit mode, I would like all forms to open to new record mode. I know I can set the main form with the switchboard manager but what about the subforms?
View 2 Replies
View Related
Jan 4, 2006
Folks,
i have two forms with a command button on the first which opens the other...
is there a way of getting this button to validate the primary key (i.e. make sure its not a duplicate) before it trys to open the next form??
i've tried to call the next record function (as the button seems not allow the next record to continue) but all this has done is delete the record and open the new form rather than stopping the action...
any help much appreciated
cheers
si
View 4 Replies
View Related
May 16, 2014
I am running up against an error "Index or Primary Key Cannot Contain Null Value". In the dialog box it doesn't give the RTE number just the description, OK & Help buttons. After some searching the description matches RTE 3058.
I have identified why it's happening and through a process of elimination it's happening in the Before Update event of a subform. I have tried to catch it in an error handler so I can have a bespoke dialog box to inform the user exactly why it's happened and then undo, but it just goes straight to the dialog box.
How I can catch this?
Access 2010.
View 8 Replies
View Related
Aug 26, 2014
I have a Form 01 that has staff names and the primary key StaffID. From this form, I want to open Form 02 to add a new record linked by the StaffID. How do I automatically populate the PK (StaffID) in Form 01 as the FK (StaffID) in Form 02?
View 1 Replies
View Related
Aug 5, 2014
I've imported some historic user data from some spreadsheets and I have a field which is a unique PIN code for each user. This is set as the primary key on my new table. Duplicates are not allowed. It's a text field with values ranging from 0005 through to 9576. The maximum allowed range of values will be from 0001 to 9999. There are currently only 300 records in the table so as you can see, there are lots of PINs available for use.
I'm building a form to allow a new user record to be created and want to automatically allocate the next available PIN. So if I was entering a new record now, the PIN to be allocated would be 0001.
how I can create an event for creating a new record that looks up the next available free PIN.
View 4 Replies
View Related
Jul 29, 2014
We are using access 2010, I have a blank form that produces an ID number for the specific record when saved. then i have other forms where the ID field is hyperlinked to the original form that was entered. I now have 2 users that are unable to open the hyperlinked form. when i login as them im able to open the hyperlinked form.
Private Sub ID_Click()
On Error GoTo Error_Catcher_1
DoCmd.OpenForm "NewRequestForm", , , "ID= " & Me.ID, acFormEdit
[code]....
View 4 Replies
View Related
May 16, 2014
My Db has a master table with a two-field primary key.
I have a main form, based on a query that primarily grabs data from that table.
The form has a subform based on a table which is the "many" side of a one-to-many relationship with the master table. I'm having a problem adding individual records to the subform.
The subform is linked via Master/child fields to the main form, but only on one of the two fields comprising the PK. When I add a new record in the sub it does not pull the PK data to the FK fields in the sub table and I suspect it is because of only having one of them properly linked.
The subform relates to an annual certification process that we track with vendors. The sub-table is populated each year with the two FK values for all qualifying vendors in one go. If I then need to add a single certification record for a single vendor I want to have a button on the subform that will pull the values from the main form fields, and ask the user for the cert year.
I tried adding a new record in vba via
Code:
Private Sub btnAddSingleRec_Click()
Forms!frmMainForm!subfrmCurrentProcess.SetFocus
DoCmd.GoToRecord , , acNewRec
DoCmd.OpenQuery "qryAddSingleCert"
with the query being an Update query with the following in the Update To line and "Is Null" in criteria:
Forms!Mainform!PKField1
Forms!Mainform!PKField2
[Enter Cert Year]
This doesn't throw an error, but the Access warnings say I'm updating 0 Rows.
View 4 Replies
View Related
Dec 16, 2013
I want my primary key to be
First 3 letters of surname + first 3 letters of forename + DD + YY (Date of birth)
I can use the after update event to update the primary key field but it won't get saved for some reason so have I missed something?
View 13 Replies
View Related
Jun 28, 2013
I want to recall a record by it's primary key in a form with a command button
I mean write a primary key in a textbox and press the button then it shows the record.
View 3 Replies
View Related
Jul 15, 2013
I have got 3 forms, and at the time of running, I want to make one primarily one form to be showing up and the other 2 to be hidden or closed, and the primary form will have 2 buttons, and clickning respective buttons should be able to open another 2 respective forms.
At the moment am using, DoCmd.OpenForm "Form1", which works fine, but am confused in brining the form 1 only to be shown at the first most time.
View 2 Replies
View Related
Jul 31, 2014
I have a form that has a FIND button. I want the user to enter the 3 fields that make up the primary key, then find the associated record. How can I do this in Access - not VBA?
View 1 Replies
View Related
Apr 1, 2015
I am building a user creation form. I set it up like the screen shot in the first attachement. 3 different tabs.
In tab 1 you create the user which then gets a unique key (DocentenID).
Tab 2 you can input more information about the user (in a different table).
I want it to grab the primary key (DocentenID) and insert that into a field in the other table same goes for tab 3.
View 1 Replies
View Related
Aug 16, 2005
Instead of using command buttons to open forms
I would like to open forms displayed in a list box
Is there a way of doing this, so for example the
listbox will show
CustomerForm
SupplierForm
OrdersForm
ProductsForm
When any of the above is clicked the relative
form will open.
Regards
jmeek
View 9 Replies
View Related
Aug 23, 2005
I have a form with a bound combo box listing names, [myname] and a multiselect list box that lists all available forms in a database [myselections]. I am really struggling with code that will enable the user to hit a command button that will then open the selected forms to show the data for the selected individual. I have found things related to selecting items in tables etc but not related to opening forms to specific entrys and I am just not experienced enough with SQL to get this working. Can anyone help or direct me to a good example?
View 1 Replies
View Related
Feb 9, 2006
I have a drop down with a list of years (2002, 2003 etc) that the user must select from. when they do so and click the GO button a new form will be displayed. I need to use this year to compare against a field in the table that the new form is using. However the field is in a dd-mm-yyyy format that can not be changed.
Is there any way i can do a like search on the value of the drop down against the value in the table to only give the records with a particular year? what i have at the moment is below but obviously this wouldnt work because it is saying, is dd-mm-yyyy like yyyy. How can i turn this like search around so its yyyy like dd-mm-yyyy?
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Master NCRs"
stLinkCriteria = "[OpenDate] like " & Me![NCRYear]
DoCmd.OpenForm stDocName, , , stLinkCriteria
thanks
View 1 Replies
View Related
Nov 17, 2006
Hi All,
I am opening one form (Form B) from within another form (Form A), I would like to stop all the followin code in Form A from being processed until Form B is closed.
Any tips?
Cheers,
Aaron
View 1 Replies
View Related
Mar 6, 2008
is there any way you can reopen the form where you last saved/closed it
e.g if i was on record 300 and then closed the form. then when i re-open the form, record 300 is displayed and then the other records after it
any help welcome
Thanks
View 11 Replies
View Related
Mar 26, 2013
I'm developing a simple sporting records db. I have a 'Competitor' table listing competitors as follows: CompetitorPK, Name, Division, Club. I have a 'Contest' table listing contests as follows: ContestPK, Competitor1_FK, Competitor2_FK, Winner_FK, Score etc. My question is have I modelled tables correctly i.e. CompetitorPK will appear in three columns of Contest table. How do I define this relationship? What alternative is there to what I have done.I intend to use forms to populate both tables (independantly obviously).
View 4 Replies
View Related
Sep 11, 2014
I am trying to get the Primary Key value from one form to auto-populate the foreign key value of a second form
I have tried the following code in both the second form's Load Event and the Foreign Key Control Got Focus Event but nothing doing...
Me.[NHS Number] = Forms![frm_Patient_Data_Entry]![NHS Number]
I am new to VBA so not sure of the referencing technique but have looked at the MVPS Form 'referencing' sheet to no avail.
I keep getting an error message (2450) MS Access cannot find the referenced form "frm_Patient_Data_Entry"
I have checked spelling throughout countless times so there must be something wrong with my referencing I guess.
View 2 Replies
View Related
Jan 31, 2005
As you Can See I have attached just one form in my database.
I have created a combo box with a value list of forms which are in my main database. And then put in command button to press to open the form you have selected in the value list.
but alas i cant get the right code to be able to open the form with the selection from the value list
Any ideas oh sooo kind people?
View 3 Replies
View Related