A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Subform New Record



 
 
Thread Tools Display Modes
  #1  
Old March 10th, 2010, 10:36 PM posted to microsoft.public.access.forms
Pam
external usenet poster
 
Posts: 131
Default Subform New Record

Is this possible? Form A opens to job number from switchboard selection
with all related data from job table.

Form B, which is a subform on Form A, opens for tech to enter name and time
started on job. If Tech1 has already started time on job and Tech2 wants to
help on same job, it opens with Tech1's time. I need Form B to open to a
new record for Tech2 to enter time, but Form A still relate to job number
selected from switchboard.

Thanks in advance for any help,
Pam


  #2  
Old March 11th, 2010, 12:27 AM posted to microsoft.public.access.forms
Allen Browne
external usenet poster
 
Posts: 11,706
Default Subform New Record

Open Form B in design view, and set its Data Entry property to Yes.

Now the subform will always open to the new record (i.e. it doesn't show any
existing records.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Pam" wrote in message
...
Is this possible? Form A opens to job number from switchboard selection
with all related data from job table.

Form B, which is a subform on Form A, opens for tech to enter name and
time started on job. If Tech1 has already started time on job and Tech2
wants to help on same job, it opens with Tech1's time. I need Form B to
open to a new record for Tech2 to enter time, but Form A still relate to
job number selected from switchboard.

Thanks in advance for any help,
Pam

  #3  
Old March 11th, 2010, 01:10 AM posted to microsoft.public.access.forms
Barry A&P[_2_]
external usenet poster
 
Posts: 119
Default Subform New Record

Pam

Is this possible? Form A opens to job number from switchboard selection
with all related data from job table.


assuming JobCode is your Primary key
place a unbound combobox on your switchboard named FindJobCodeCombo that has
your job number as its recordsource and on its afterupdate event put code
like this..

'*********** Code For FindJobCodeCombo **************
Private Sub FindJobCodeCombo_AfterUpdate()
On Error GoTo Err_FindJobCodeCombo_AfterUpdate

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Name of form A"
stLinkCriteria = Me!FindJobCodeCombo
DoCmd.OpenForm stDocName, , , , , , stLinkCriteria
Me!FindJobCodeCombo = Null

Exit_FindJobCodeCombo_AfterUpdate:
Exit Sub

Err_FindJobCodeCombo_AfterUpdate:
MsgBox Err.Description
Resume Exit_FindJobCodeCombo_AfterUpdate

End Sub

and this on FormA's on load

Private Sub Form_Load()
Dim rs As Object

If Me.OpenArgs = "GotoNew" And Not IsNull(Me![JobCode])
DoCmd.DoMenuItem acFormBar, 3, 0, , acMenuVer70
ElseIf Len(Me.OpenArgs & vbNullString) 0 Then
Set rs = Me.Recordset.Clone
rs.FindFirst "[JobCode] = " & Str(Nz(Me.OpenArgs, 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End If

End Sub


Form B, which is a subform on Form A, opens for tech to enter name and time
started on job. If Tech1 has already started time on job and Tech2 wants to
help on same job, it opens with Tech1's time. I need Form B to open to a
new record for Tech2 to enter time, but Form A still relate to job number
selected from switchboard.


Maybe formB should just be set to Datasheet view. and 80 techs could all
work the same job..

assuming you have a job codes table
and a linked table that has Times worked on job codes


link the two forms on JobCode then hide the jobCode field on the subform and
all records created in the datasheet subform will be for the jobcode listed
in FormA



Barry


Thanks in advance for any help,
Pam


.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:15 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.