|
-
Jan 17th, 2006, 08:55 PM
#41
Re: [RESOLVED] How to set current date..??
Your going to have to move the rst recordset to whatever row your focussing on. Your going to have to loop until your rst is on the table cell that has the focus or is selected.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 17th, 2006, 09:59 PM
#42
Thread Starter
Addicted Member
-
Jan 18th, 2006, 06:17 AM
#43
Thread Starter
Addicted Member
Re: [RESOLVED] How to set current date..??
Dear Experts,
I really need your help with this codes...I tried many time and this is my last codes but still wont work...please help me:
VB Code:
Private Sub CommandButton3_Click()
Dim con As ADODB.Connection
Set con = New ADODB.Connection
con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\exercise.mdb"
If Not TypeName(rst) = "Nothing" Then
'something
Dim ItemCode As String
rst.MoveFirst
Do While rst.EOF = False
ItemCode = Trim$(cmb_item)
If ItemCode <> "" Then
' Restrict/filter the recordset by the selected Item_Code
Debug.Print "Item_Code=" & ItemCode
rst.Filter = "Item_Code = " & ItemCode
End If
If UserForm1.txtqty.Text = rst.Fields("Item_Code").Value Then
Exit Do
rst.MoveNext
Loop
If rst.State = adStateOpen Then
'open
rst.Close
Set rst = Execute_SQL_ReturnRecordSet("Select * from Item", , _
"C:\exercise.mdb")
Else
'closed
Set rst = Execute_SQL_ReturnRecordSet("Select * from Item", , _
"C:\exercise.mdb")
End If
Else
'nothing
Set rst = Execute_SQL_ReturnRecordSet("Select * from Item", , _
"C:\exercise.mdb")
End If
TextBox3.Text = rst.Fields("Qty")
End Sub
I am very appreciate if you make a correction for this code to make it run...by only giving advice could not solve the problem because I know the logic BUT i dont know what should I put on first (the code) and what next and what next...before I see the sample...example...etc...about how to write its codes...so, please be understood.....
Thanks a lot for your kind helps...
-
Jan 18th, 2006, 08:48 AM
#44
Thread Starter
Addicted Member
Re: [RESOLVED] How to set current date..??
Hi Rob,
Sorry...would you like to help me to find the code please..???
Thanks very much for your kindness..
Jennifer
-
Jan 18th, 2006, 07:16 PM
#45
Thread Starter
Addicted Member
Re: [RESOLVED] How to set current date..??
Please help me with this codes...only one step to finish...thanks a lot,
Jennifer
-
Jan 19th, 2006, 05:30 AM
#46
Re: [RESOLVED] How to set current date..??
You need to compare the item id with the item id and not qty.
VB Code:
If UserForm1.txtqty.Text = rst.Fields("Item_Code").Value Then
'Should be - Item_Code or whatever the txt name is.
If UserForm1.txtItem_Code.Text = rst.Fields("Item_Code").Value Then
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 19th, 2006, 09:55 AM
#47
Thread Starter
Addicted Member
Re: [RESOLVED] How to set current date..??
Hi,
I tried but still error:
VB Code:
Private Sub cmd_CheckCurrent_Click()
Dim con As ADODB.Connection
Set con = New ADODB.Connection
con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\exercise.mdb"
If Not TypeName(rst) = "Nothing" Then
'something
Dim ItemCode As String
rst.MoveFirst
Do While rst.EOF = False
ItemCode = Trim$(cmb_item)
If ItemCode <> "" Then
' Restrict/filter the recordset by the selected Item_Code
Debug.Print "Item_Code=" & ItemCode
rst.Filter = "Item_Code = " & ItemCode
End If
If UserForm1.cmb_item.Text = rst.Fields("Item_Code").Value Then
Loop
rst.MoveNext
If rst.State = adStateOpen Then
'open
rst.Close
Set rst = Execute_SQL_ReturnRecordSet("Select * from Item", , _
"C:\exercise.mdb")
Else
'closed
Set rst = Execute_SQL_ReturnRecordSet("Select * from Item", , _
"C:\exercise.mdb")
End If
Else
'nothing
Set rst = Execute_SQL_ReturnRecordSet("Select * from Item", , _
"C:\exercise.mdb")
End If
End Sub
-
Jan 19th, 2006, 10:15 AM
#48
Re: [RESOLVED] How to set current date..??
If its not matching with the value in the database you need to check the values manually. Do a Debug.Print of each value to be compared, combo and database. If the combo's value has no trailing spaces then it should be jsut the word. If the value in the database, more then likely, has trailing spaces then the two items will not match.
Also what is the type for the db field?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 19th, 2006, 08:06 PM
#49
Thread Starter
Addicted Member
Re: [RESOLVED] How to set current date..??
Hi,
I am using ADO, and the database is Ms Access........is there any tutorial/how to now the codes look like for this kind of form in Ms Words please...???...like auto increment number, line this kind questions I asked you...etc????..Is possible to have a look by looking from Macro record..???
Thanks,
Jennifer
-
Jan 19th, 2006, 09:06 PM
#50
Re: [RESOLVED] How to set current date..??
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 20th, 2006, 03:39 AM
#51
Thread Starter
Addicted Member
Re: [RESOLVED] How to set current date..??
Hi Rob,
I read trough all related FAQ but there is no answer or example there....especially for "Check Current Stock"...is it possible for me to know that codes please...because I intent to put all codes and file once the form is already done in VBFORUMS tutorial...
-
Jan 22nd, 2006, 09:32 PM
#52
Thread Starter
Addicted Member
Re: [RESOLVED] How to set current date..??
Hi Rob,
Sorry.. I just wanna ask...why dont you just fix that codes please..???...That is not only for me...Because you could post this issue of Word VBA on the tutorial so everybody can see it and learn from codes how to build that form, etc...and this forum will be the total solution forum with complete example...since other forums are not so good as VBFORUMS....
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
|