473,624 Members | 2,254 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Assigning Default Value

Hello,
I have a field called 'TestGrade'in a subform called
'frmSelectByTes tSub'that I need to assign a default value to, and the
value needs to be an integer value that is exactly the same as the
value in a field called 'Grade' that is also in the subform. The name
of the main form is 'frmSelectByTes t'. The 'SourceObject' of the
subform and the subform name are the same.

'Grade' in the subform can be different for each student record
selected from a dropdown list in the main form.

I've tried to use the On_Current event of the subform to evaluate the
value of 'Grade', and set the Default property of 'TestGrade' = to
that value, but that did not work.

I tried to just express [Grade] right within the 'Default Value'
property of TestGrade, but that did not work either.

As I'm thinking about it, maybe the Default Value assignment needs to
take place during the _AfterUpdate or _OnChange event of the combo box
in the main form.

What should I do to have the Default Value of 'TestGrade' reflect the
Value of 'Grade'?

Thank you for your help!

CSDunn
Nov 13 '05 #1
2 2114
Yes, use the combo's AfterUpdate event:

Private Sub Combo1_AfterUpd ate
If Not IsNull(Me.Combo 1) Then
Me.frmSelectByT estSub.Form.Tes tGrade.DefaultV alue = CStr(Me.Combo1)
End If
End Sub

--
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.

"CSDunn" <cd***@valverde .edu> wrote in message
news:80******** *************** ***@posting.goo gle.com...
Hello,
I have a field called 'TestGrade'in a subform called
'frmSelectByTes tSub'that I need to assign a default value to, and the
value needs to be an integer value that is exactly the same as the
value in a field called 'Grade' that is also in the subform. The name
of the main form is 'frmSelectByTes t'. The 'SourceObject' of the
subform and the subform name are the same.

'Grade' in the subform can be different for each student record
selected from a dropdown list in the main form.

I've tried to use the On_Current event of the subform to evaluate the
value of 'Grade', and set the Default property of 'TestGrade' = to
that value, but that did not work.

I tried to just express [Grade] right within the 'Default Value'
property of TestGrade, but that did not work either.

As I'm thinking about it, maybe the Default Value assignment needs to
take place during the _AfterUpdate or _OnChange event of the combo box
in the main form.

What should I do to have the Default Value of 'TestGrade' reflect the
Value of 'Grade'?

Thank you for your help!

CSDunn

Nov 13 '05 #2
Allen,
Thank you for your help, I will try this.

CSDunn

"Allen Browne" <Al*********@Se eSig.Invalid> wrote in message news:<40******* *************** @per-qv1-newsreader-01.iinet.net.au >...
Yes, use the combo's AfterUpdate event:

Private Sub Combo1_AfterUpd ate
If Not IsNull(Me.Combo 1) Then
Me.frmSelectByT estSub.Form.Tes tGrade.DefaultV alue = CStr(Me.Combo1)
End If
End Sub

--
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.

"CSDunn" <cd***@valverde .edu> wrote in message
news:80******** *************** ***@posting.goo gle.com...
Hello,
I have a field called 'TestGrade'in a subform called
'frmSelectByTes tSub'that I need to assign a default value to, and the
value needs to be an integer value that is exactly the same as the
value in a field called 'Grade' that is also in the subform. The name
of the main form is 'frmSelectByTes t'. The 'SourceObject' of the
subform and the subform name are the same.

'Grade' in the subform can be different for each student record
selected from a dropdown list in the main form.

I've tried to use the On_Current event of the subform to evaluate the
value of 'Grade', and set the Default property of 'TestGrade' = to
that value, but that did not work.

I tried to just express [Grade] right within the 'Default Value'
property of TestGrade, but that did not work either.

As I'm thinking about it, maybe the Default Value assignment needs to
take place during the _AfterUpdate or _OnChange event of the combo box
in the main form.

What should I do to have the Default Value of 'TestGrade' reflect the
Value of 'Grade'?

Thank you for your help!

CSDunn

Nov 13 '05 #3

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

Similar topics

10
1812
by: Matthew Sims | last post by:
Python Newbie here. This is my first time learning object-oriented programming and trying to break out of the usual Korn/Perl/PHP style of programming. Having some difficulty understand some items. For lists, I understand this: C= print C some But I can't seem to do this:
1
2169
by: Jenny | last post by:
Hi, Can I create an array of tags by assigning same name to these tags? For example, I have two <p> tags with the same name t1. But document.all.b.value=document.all.t.length does not work. It works if the tags are <input type=radio...>. This line is OK:
2
9213
by: Moshe Lupiansky via .NET 247 | last post by:
(Type your message here) 1 - How do I programmatically assign a value to a specified cell in a DataGrid? Something like DataGrid1(3,8) = "ABC" 2 - When I am going to the last row (the empty one)in order to insert a new record into the DB, I want the default values of the fields that do have default values to be displayed when I first enter this row. How do I achieve it? -------------------------------- From: Moshe Lupiansky ...
3
1547
by: | last post by:
T.I.A. to whomever replys... I'm new to ASP. I'm reading input from a flat-file (not a DB) using a vbscript routine to display on an ASP form so that a user can update the info, submitting the form back to update the file. When I tried the html command: document.myformname.myfieldname.value = myvarname I get an object error msg. What is the correct ASP syntax for doing this?
7
3444
by: Adrian Parker | last post by:
'function to convert null to nothing Function CheckDate(ByVal DRow As DataRow, ByVal strCol As String) As Date If DRow.Item(strCol) Is System.DBNull.Value Then Return Nothing Else Return DRow.Item(strCol) End If End Function
2
2580
by: Bernie Hunt | last post by:
I'm having trouble assigning the reportsource value at run time. I'm running a test setup, one form with only a Crystal Viewer, called cvwMail. My report is called CustomersBasic.rpt and it draws directly from the TradeWinds.MDB test database. If I use Me.cvwMain.ReportSource = "J:\Learning\CMP 214\Crystal Test\CrystalTest \CustomersBasic.rpt to point to the file directly it works.
2
6434
by: Lucky | last post by:
Hi guys, i was working with Enum and one Question strike, i thought it would be good idea to ask more experience guys around. the scenerio is like this : public enum check {
3
2206
by: Froefel | last post by:
Hi group I am creating a web application that uses a simple DAL as an ObjectDataSource. To retrieve data from the database, I use a DataReader object from which I then assign the various fields to properties in an object, like so: in the DB, the fields are defined as follows: ProjectID int NOT NULL
1
2032
by: balakrishnan.dinesh | last post by:
Hi frndz , I want to assgin value to <input type=file, without clicking browse button , And i know that it is readonly , But how it is possible in Firfox browsers ?.. Is there any alternative solution to achieve this is IE browser?...
0
8675
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8619
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8334
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7158
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2604
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.