Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / July 2007

Tip: Looking for answers? Try searching our database.

Date in VBA Problem ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Naveed Pathan - 09 Jul 2007 12:02 GMT
i have a problem ; how to solve that first let give you the table structure
that i have
i
1) [Sno] number
2) [item]  Text
3) [Price]  number
4) [Date]  Date/time

so i want to have a coding on a button on FORM such as

Private Sub Command4_Click()
With Form_Form1.Recordset
.MoveFirst
While (Not .EOF)
If (Form_Form1.item = "apple") Then
Form_Form1.price = 100
End If
.MoveNext
Wend
End With

End Sub

so the above coding do work and give the desire result  [Price] 100 for
[tem] Apple
but i want to how to change the item price for a specific date item to 200

or

how to change today's date item  apple price to 200
thanks

hope u got i
ruralguy - 09 Jul 2007 12:07 GMT
Why not use a query to effect the changes?  Have you played with the query
builder?

>i have a problem ; how to solve that first let give you the table structure
>that i have
[quoted text clipped - 29 lines]
>
>hope u got i

Signature

HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Naveed Pathan - 09 Jul 2007 12:14 GMT
i need to know first the VBA Coding

second option would be the querry so teach me the querry option to make the
changes how to do that ............

> Why not use a query to effect the changes?  Have you played with the query
> builder?
[quoted text clipped - 32 lines]
> >
> >hope u got i
ruralguy - 09 Jul 2007 12:24 GMT
Hi Naveed,
Start with a select query and see if you can pull the records you want by
putting criteria in certain fields.  Once you get the results you want then
change the query to an Update query.  The point is you need to *play* with a
select query until you get it right.

Are you taking a class?  Is this some course work?

>i need to know first the VBA Coding
>
[quoted text clipped - 6 lines]
>> >
>> >hope u got i

Signature

HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Naveed Pathan - 09 Jul 2007 12:36 GMT
thanks for the select querry to update

but do u know plz how to do that in VBA

i guess tha is simple but i don't know that how to do

thanks

> Hi Naveed,
> Start with a select query and see if you can pull the records you want by
[quoted text clipped - 14 lines]
> >> >
> >> >hope u got i
ruralguy - 09 Jul 2007 14:41 GMT
If .item = "apple" AND .DateField = #07/08/2007# Then

>thanks for the select querry to update
>
[quoted text clipped - 9 lines]
>> >> >
>> >> >hope u got i

Signature

HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

jahoobob - 09 Jul 2007 15:55 GMT
Folks, One of the Access(SQL commandments is:
"THOU SHALT NOT USE A RESERVED WORD AS A FIELD NAME!"
I believe that Date is probably the most misused reserved word.
Change [Date] and see what happens.  Even if this doesn't fix your problem
you've got a clean slate from which to work on the real problem.

>i have a problem ; how to solve that first let give you the table structure
>that i have
[quoted text clipped - 29 lines]
>
>hope u got i
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.