473,407 Members | 2,546 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,407 software developers and data experts.

bringing up the right record

hey... i have a form who's recordsource is a 3-field table. this form
prompts the user to enter a quarter and a year (which it then turns into a
date in an invisible control -- this control is bound to the date field in
the table, which is also the primary key) and then for 2 numbers, which it
then uses to open a quarterly report for my store. the form is
formfiquarterly, the controls are txtboxquarter, txtboxyear, txtboxdate (the
invisible one), txtboxnewFunits, txtboxusedFunits.

the way i have it set up, when you choose a quarter and a year, it will
calculate the date automatically. then, you enter the 2 unit fields before
clicking the button that opens the report. at that point, the form closes,
saving the units and the date to the table.

now, the problem is when i open the form, the date field DOES have the
recorded date in it but you can't see it. the two unit controls (bound) DO
show the corresponding units for that quarter that were used to generate the
report. what i need is for txtboxyear and txtboxquarter (which is a combo
box that i never changed the prefix for) to show the correct quarter and year
based on the date in txtboxdate. right now, it does not do this.

i don't know if you need to see this, but this is the code i have on the form:
Private Sub txtboxquarter_AfterUpdate()
Dim strdate As Date

If IsNull(Me.txtboxyear) = True Then
Exit Sub
Else
If Me.txtboxquarter = "1st Quarter" Then
strdate = DateSerial(Me.txtboxyear, 1, 1)
ElseIf Me.txtboxquarter = "2nd Quarter" Then
strdate = DateSerial(Me.txtboxyear, 4, 1)
ElseIf Me.txtboxquarter = "3rd Quarter" Then
strdate = DateSerial(Me.txtboxyear, 7, 1)
ElseIf Me.txtboxquarter = "4th Quarter" Then
strdate = DateSerial(Me.txtboxyear, 10, 1)
End If
End If

Me.txtboxdate = strdate

End Sub
Private Sub txtboxyear_AfterUpdate()
Dim strdate As Date

If IsNull(Me.txtboxquarter) = True Then
Exit Sub
Else
If Me.txtboxquarter = "1st Quarter" Then
strdate = DateSerial(Me.txtboxyear, 1, 1)
ElseIf Me.txtboxquarter = "2nd Quarter" Then
strdate = DateSerial(Me.txtboxyear, 4, 1)
ElseIf Me.txtboxquarter = "3rd Quarter" Then
strdate = DateSerial(Me.txtboxyear, 7, 1)
ElseIf Me.txtboxquarter = "4th Quarter" Then
strdate = DateSerial(Me.txtboxyear, 10, 1)
End If
End If
Me.txtboxdate = strdate

End Sub

if it helps to know this, what i had initially was an unbound form until i
realized that i needed to save the two numbers in the db somehow so that when
i want to look at an old quarterly report, i have all the parameters that i
used to generate it in the first place. i REALLY want to keep the design of
the combo box for the quarter and the text box for the year because of the
end-users of this form and their comfort level with computers. thanks for
your help here.

--
Greg

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200602/1
Feb 15 '06 #1
0 1109

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

Similar topics

10
by: Paul Kooistra | last post by:
I need a tool to browse text files with a size of 10-20 Mb. These files have a fixed record length of 800 bytes (CR/LF), and containt records used to create printed pages by an external company. ...
16
by: Fox | last post by:
I merged and modified these script which work perfectly fine as long as I use server.execute to access the VBS part (which is itself in another ASP file). When these I use a session variable to...
13
by: Martin Dennett | last post by:
Hi I'm new to this group so go easy on me! I currently use a database that has had one constant niggle for a while and I was wondering if anybody can help sort it out. From an opening screen...
2
by: John M | last post by:
Hi, I have a continuous form which shows a record on each line. Further details are available by clicking on a box which runs code to open a further form to give more details of the record. It...
2
by: Mike Turco | last post by:
I like using the expression builder for a lot of different things but it isn't always available when I want to use it, for example in the code window, or in all of the control properties. I am...
0
by: davidgreen24 | last post by:
Suppose I have a SQLDataSource object that returns 20 rows. I have a FormView object bound to this control. Now when I click a hyperlink (with querystring param called productID) I want the row...
0
subashini Thiyagarajan
by: subashini Thiyagarajan | last post by:
i am creating some pages using ASP and Access .... i want to bring outlook mail to my asp page then it should store it to access database. any one know how to do... Normally we can drag the...
3
by: Hirsute | last post by:
Simple question for MS Access 2003 (using VBA)... I have "continuous" form (e.g. showing many records on a single form window). When I simply click (primary click) on one of those records it...
16
by: AdamOnAccess | last post by:
I'm trying to trigger some code to fire right after a user enters their first character into any field in the record. I can't seem to identify the proper event. I'm having a little difficulty...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.