|
-
Oct 28th, 2009, 07:52 AM
#1
Thread Starter
Junior Member
datepicker problem
hello,i have this code
Code:
Option Explicit
Private Sub Form_Load()
Me.pump.AddItem "P1--01"
Me.pump.AddItem "P3--03"
Me.pump.AddItem "P4--04"
Me.pump.AddItem "P5--05"
Me.DataGrid.Visible = True
End Sub
Private Sub pump_Click()
dim dbfilename as stirng
Dim oRs As New ADODB.Recordset
Dim adoConn As ADODB.Connection
Set adoConn = New ADODB.Connection
Do
createDummyBase Me.DTP1_date.value, Me.DTP1_hour.value, Me.DTP2_date.value, Me.DTP2_hour.value, 20, pump.Text
dbFilename = "Report_" & Format(Now, "MM_YY") & ".mdb"
adoConn.ConnectionString = BuildConnectionString(dbFilename)
adoConn.Open
oRs.Open "select * from Report", adoConn, adUseClient, adLockOptimistic
Set DataGrid.DataSource = oRs
DataGrid.AllowAddNew = True
DataGrid.Visible = True
DataGrid.Refresh
Debug.Print oRs.RecordCount
End Sub
in the form load i have one combobox called pump which have four values(P1,P3,P4,P5) and four datepickers , two for selecting the date and two for selecting the hour , called: DTP1_date,DTP1_hour,DTP2_date,DTP2_hour .
i want when i choose the DTP1_date,DTP1_hour,DTP2_date,DTP2_hour in the form load to pass their values in the createDummyBase sub(not manully with code).
the .value property of dtpicker doesnot exist.any ideas ?please help.thx
-
Oct 28th, 2009, 08:12 AM
#2
Re: datepicker problem
Initialize then in the form load...
vb Code:
Private Sub Form_Load() With Me.pump .AddItem "P1--01" .AddItem "P3--03" .AddItem "P4--04" .AddItem "P5--05" End With DTP1_date.Value = ??? '<~~ Set Default Values Here DTP1_hour.Value = ??? '<~~ Set Default Values Here DTP2_date.Value = ??? '<~~ Set Default Values Here DTP2_hour.Value = ??? '<~~ Set Default Values Here Me.DataGrid.Visible = True End Sub
Also what is createDummyBase sub() ?
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Oct 28th, 2009, 08:34 AM
#3
Thread Starter
Junior Member
Re: datepicker problem
 Originally Posted by koolsid
Initialize then in the form load...
vb Code:
Private Sub Form_Load()
With Me.pump
.AddItem "P1--01"
.AddItem "P3--03"
.AddItem "P4--04"
.AddItem "P5--05"
End With
DTP1_date.Value = ??? '<~~ Set Default Values Here
DTP1_hour.Value = ??? '<~~ Set Default Values Here
DTP2_date.Value = ??? '<~~ Set Default Values Here
DTP2_hour.Value = ??? '<~~ Set Default Values Here
Me.DataGrid.Visible = True
End Sub
Also what is createDummyBase sub() ?
as i said the .value property of dtpicker doesnot exist.
i do not want to pass the value of the datepicker with code but when i chose the date and time from the datepickers in the form load.
the createdummybase is a sub which creates a .mdb database.
the createdummybase i want to take the arguments of the selected date and time of the datepickers and from the combobox called pump.how can i do that ?thx
-
Oct 28th, 2009, 09:45 AM
#4
Re: datepicker problem
when i chose the date and time from the datepickers in the form load.
You mean after form load?
Before you click the combo do you select the vaues of DTP manually? If not then the value of the DTP will not be passed to createdummybase() correctly...
You can set the value of the DTP either in the form load or you will have to set the value of DTP manually before clicking the Combo....
Hope I have understood your query correctly?
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Oct 28th, 2009, 10:44 AM
#5
Re: datepicker problem
as i said the .value property of dtpicker doesnot exist.
That is odd...!
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Oct 28th, 2009, 11:28 AM
#6
Thread Starter
Junior Member
Re: datepicker problem
 Originally Posted by akhileshbc
That is odd...!
i havent used the correct control names ..you were right.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|