473,396 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Subform Data

I have a main form with customer information and a Job_No on it. I also have
a button to call a subform. How do I pupulate the Job_No into the subform
when it loads up. Thanks
Nov 12 '05 #1
3 2187
Add this line of code to your code that opens the subfrom after the
DoCmd.OpenForm:

Me!NameOfSubformControl![Job_No] = Me![Job_No]
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"home" <re**@telkomsa.net> wrote in message
news:bp**********@ctb-nnrp2.saix.net...
I have a main form with customer information and a Job_No on it. I also have
a button to call a subform. How do I pupulate the Job_No into the subform
when it loads up. Thanks

Nov 12 '05 #2
I have tried what you suggested but still no joy, this is what my cade looks

like.

Private Sub cmb_NewJob_Click()

On Error GoTo Err_cmb_NewJob_Click

Dim stDocName As String

Dim stLinkCriteria As String

stDocName = "Job subform"

stLinkCriteria = "[Job_No]=" & "'" & Me![Job_No] & "'"

DoCmd.OpenForm stDocName, , , stLinkCriteria

'

Exit_cmb_NewJob_Click:

Exit Sub

Err_cmb_NewJob_Click:

MsgBox Err.Description

Resume Exit_cmb_NewJob_Click

End Sub

my Job_No on subform comes up blank every time!


"PC Datasheet" <sp**@nospam.spam> wrote in message
news:Sa*****************@newsread2.news.atl.earthl ink.net...
Add this line of code to your code that opens the subfrom after the
DoCmd.OpenForm:

Me!NameOfSubformControl![Job_No] = Me![Job_No]
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"home" <re**@telkomsa.net> wrote in message
news:bp**********@ctb-nnrp2.saix.net...
I have a main form with customer information and a Job_No on it. I also have a button to call a subform. How do I pupulate the Job_No into the subform when it loads up. Thanks


Nov 12 '05 #3
Instead of just setting the value of the Job No, set the default value of
the control that holds it...

"home" <re**@telkomsa.net> wrote in message
news:bp**********@ctb-nnrp2.saix.net...
I have tried what you suggested but still no joy, this is what my cade looks
like.

Private Sub cmb_NewJob_Click()

On Error GoTo Err_cmb_NewJob_Click

Dim stDocName As String

Dim stLinkCriteria As String

stDocName = "Job subform"

stLinkCriteria = "[Job_No]=" & "'" & Me![Job_No] & "'"

DoCmd.OpenForm stDocName, , , stLinkCriteria

'

Exit_cmb_NewJob_Click:

Exit Sub

Err_cmb_NewJob_Click:

MsgBox Err.Description

Resume Exit_cmb_NewJob_Click

End Sub

my Job_No on subform comes up blank every time!


"PC Datasheet" <sp**@nospam.spam> wrote in message
news:Sa*****************@newsread2.news.atl.earthl ink.net...
Add this line of code to your code that opens the subfrom after the
DoCmd.OpenForm:

Me!NameOfSubformControl![Job_No] = Me![Job_No]
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"home" <re**@telkomsa.net> wrote in message
news:bp**********@ctb-nnrp2.saix.net...
I have a main form with customer information and a Job_No on it. I
also
have a button to call a subform. How do I pupulate the Job_No into the subform when it loads up. Thanks



Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
3
by: Nicolae Fieraru | last post by:
Hi All, I have a problem and I can't figure out how to solve it. My database has three tables: tblCustomers, with CustomerId and CustomerName tblProducts, with ProductId and ProductCode...
12
by: MLH | last post by:
I have created two forms: frmBrowseNegsMainform and frmBrowseNegsSubform. I put a subform control on the first of these. The SourceObject property for the subform control is, of course,...
1
by: Donna Sabol | last post by:
I have a form (frm_MAIN_RPT) that contains a combo box (Combo6) & subform (dbo_REQ_subform). The combo box is used to select the "cost center" data that will be displayed in the subform. From...
4
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
4
by: aqua404 | last post by:
I know this has been discussed, but I can't find a resolution. I have a subform on a form. The table with the data for the main form has 15,000 records. I am opening and then setting...
1
by: google | last post by:
I have a form with several subforms. Users enter the data, then on the parent there is a command button that runs code to generate a .pdf document from a report based on the data they are working...
9
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a...
4
by: Macbane | last post by:
Hi, I have a 'main' form called frmIssues which has a subform control (named linkIssuesDrug) containing the subform sfrmLink_Issues_Drugs. A control button on the main form opens a pop-up form...
1
by: Stinky Pete | last post by:
Hi everyone, I have been updating a file that uses a main form that contains a subform (as a datasheet). The main form really does not do anything on opening except maximizes to the users...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.