http://groups.google.com/group/microsoft.public.access.modulesdaovba?hl=en
microsoft.public.access.modulesdaovba@googlegroups.com
Today's topics:
* get response from command button - 2 messages, 2 authors
http://groups.google.com/group/microsoft.public.access.modulesdaovba/browse_thread/thread/88196da848e7eafa?hl=en
* MS Access 2002 problem with subform - 3 messages, 2 authors
http://groups.google.com/group/microsoft.public.access.modulesdaovba/browse_thread/thread/04d9b0be493dbc86?hl=en
* Database opens slowly. - 1 messages, 1 author
http://groups.google.com/group/microsoft.public.access.modulesdaovba/browse_thread/thread/b13aaafc45780317?hl=en
* Creating a query with Multi select list boxes - 4 messages, 3 authors
http://groups.google.com/group/microsoft.public.access.modulesdaovba/browse_thread/thread/62d81110c3598798?hl=en
* determining if this is the first new record in a subform - 2 messages, 2
authors
http://groups.google.com/group/microsoft.public.access.modulesdaovba/browse_thread/thread/32f8708d3a999813?hl=en
* Search Form - 2 messages, 2 authors
http://groups.google.com/group/microsoft.public.access.modulesdaovba/browse_thread/thread/e59eb5434290efac?hl=en
* Commndbars collection does not contain menus? - 3 messages, 2 authors
http://groups.google.com/group/microsoft.public.access.modulesdaovba/browse_thread/thread/2c72c6e2e92ddb08?hl=en
* exif data from jpg's - 1 messages, 1 author
http://groups.google.com/group/microsoft.public.access.modulesdaovba/browse_thread/thread/4b577c7fec3e2b7e?hl=en
* How do I return a Percentile Rank in Microsoft Access? - 1 messages, 1
author
http://groups.google.com/group/microsoft.public.access.modulesdaovba/browse_thread/thread/ae9f54d2818421f3?hl=en
* Dynamic INSERT INTO command - 3 messages, 3 authors
http://groups.google.com/group/microsoft.public.access.modulesdaovba/browse_thread/thread/b86524aeb23f77e0?hl=en
* help with replace function - 3 messages, 2 authors
http://groups.google.com/group/microsoft.public.access.modulesdaovba/browse_thread/thread/8d3f93c1a139047b?hl=en
==============================================================================
TOPIC: get response from command button
http://groups.google.com/group/microsoft.public.access.modulesdaovba/browse_thread/thread/88196da848e7eafa?hl=en
==============================================================================
== 1 of 2 ==
Date: Wed, Nov 21 2007 12:50 am
From: Bruce
Hi - I am trying to run a report with the function below. I wish to open the
form 'frm_Trade_Param' to select some query filters and then run the report.
Basically I wish to get a response from this form and continue my code as
follows;
cb_A is a command button. If this is pressed the report is run.
cb_B is also a command button. If this is pressed then the macro exits and
the form is closed.
I can do this from the form directly but I don't want to hard code this into
the form because I wish to reuse for other reports. Basically this is similar
to a vb yes/no response. How can I adjust my code to do this?
Bruce
Function rpt_Trades_Complete()
DoCmd.OpenForm "frm_Trade_Param", acNormal, "", "", , acNormal
If cb_A is pressed Then
DoCmd.OpenReport "rpt_Trades_Complete", acViewNormal, "", "", acNormal
ElseIf cb_B is pressed Then
DoCmd.Close acForm, "frm_Trade_Param"
End If
End Function
== 2 of 2 ==
Date: Wed, Nov 21 2007 2:05 am
From: "Albert D. Kallal"
I explain in detail how to do this here:
http://www.members.shaw.ca/AlbertKallal/Dialog/Index.html
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com
==============================================================================
TOPIC: MS Access 2002 problem with subform
http://groups.google.com/group/microsoft.public.access.modulesdaovba/browse_thread/thread/04d9b0be493dbc86?hl=en
==============================================================================
== 1 of 3 ==
Date: Wed, Nov 21 2007 2:52 am
From: mirceaar
I have an Access 2002 database.
On a form there is a subform containing a query that selects data from one
single table according to a few criterias on the parent form.
I have started this database a while ago and at that time I could select
and/or edit values in that subform that were reflected in the source table,
with no problem whatsoever.
Now, with no changes to this database - from my knolwledge at least - I
cannot edit any record from the subform. I can delete them.
If I go into RecordSource property of the subform I can edit the query, I
can also run it and edit the values within it, and the values change the
source table.
If I try to do this from the (sub)form, no change.
Any ideas...?
== 2 of 3 ==
Date: Wed, Nov 21 2007 4:21 am
From: "Allen Browne"
Check the properties of the form (i.e. the form that is the subform, looking
at the properties of the Form, not of some control.)
Particularly:
Allow Edits Yes
Recordset Type Dynaset
--
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.
"mirceaar" <mirceaar@discussions.microsoft.com> wrote in message
news:C89EF827-6E59-4DA4-8026-B089DE341102@microsoft.com...
>I have an Access 2002 database.
> On a form there is a subform containing a query that selects data from one
> single table according to a few criterias on the parent form.
> I have started this database a while ago and at that time I could select
> and/or edit values in that subform that were reflected in the source
> table,
> with no problem whatsoever.
> Now, with no changes to this database - from my knolwledge at least - I
> cannot edit any record from the subform. I can delete them.
> If I go into RecordSource property of the subform I can edit the query, I
> can also run it and edit the values within it, and the values change the
> source table.
> If I try to do this from the (sub)form, no change.
> Any ideas...?
== 3 of 3 ==
Date: Wed, Nov 21 2007 6:02 am
From: mirceaar
It seems the subform detail was locked.
I discovered this just before I read your post.
Strangely, I don't remember locking it, nor have I had any reason to do such
a dumb thing, either by hand or through code...
Thanks anyway
"Allen Browne" wrote:
> Check the properties of the form (i.e. the form that is the subform, looking
> at the properties of the Form, not of some control.)
>
> Particularly:
> Allow Edits Yes
> Recordset Type Dynaset
>
> --
> 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.
>
> "mirceaar" <mirceaar@discussions.microsoft.com> wrote in message
> news:C89EF827-6E59-4DA4-8026-B089DE341102@microsoft.com...
> >I have an Access 2002 database.
> > On a form there is a subform containing a query that selects data from one
> > single table according to a few criterias on the parent form.
> > I have started this database a while ago and at that time I could select
> > and/or edit values in that subform that were reflected in the source
> > table,
> > with no problem whatsoever.
> > Now, with no changes to this database - from my knolwledge at least - I
> > cannot edit any record from the subform. I can delete them.
> > If I go into RecordSource property of the subform I can edit the query, I
> > can also run it and edit the values within it, and the values change the
> > source table.
> > If I try to do this from the (sub)form, no change.
> > Any ideas...?
>
>
==============================================================================
TOPIC: Database opens slowly.
http://groups.google.com/group/microsoft.public.access.modulesdaovba/browse_thread/thread/b13aaafc45780317?hl=en
==============================================================================
== 1 of 1 ==
Date: Wed, Nov 21 2007 2:59 am
From: RobGMiller
Hi Tony,
Yes, I did that as well. I just did it again to be sure because there is the
issue of the "Visual Basic for Applications project in the database is
corrupt" that keeps comming up. After reading about it, I gather that the
message is eroneous and probably has something to do with the fact that this
is a 2003.
In any case, I used a blank database and decompiled first. I got the same
error message. That proves, I suppose, that the message is eroneous. Then I
Imported all the objects, they I decompiled it, then I compacted it. They I
linked all the tables.
Now its a bit faster to open but still takes about 15 seconds before the
autoexec runs or a display form shows but there are all kinds of the types of
errors that are not obvious and difficult to debug.
So I go back to the original and wonder if I can make that splash screen
come up any sooner somehow.
I gather that there is nothing I can do other than try to figure out what
objects break when the above technique is used to speed it up and why it
really doesn't speed it up enough.
If the application compiles without error and does work well then what kinds
of things can keep it from loading fast and what kinds of things can cause a
decompile to break the objects to the point where they wont work any longer.
--
RobGMiller
"Tony Toews [MVP]" wrote:
> RobGMiller <RobGMiller@discussions.microsoft.com> wrote:
>
> >Yes, it did speed it up a bit but it still takes about 15 seconds before
> >either the autoexec runs or the assigned display form comes up.
>
> Ok, now try the decompile on the new MDB. After making a copy of it.
>
> Tony
> --
> Tony Toews, Microsoft Access MVP
> Please respond only in the newsgroups so that others can
> read the entire thread of messages.
> Microsoft Access Links, Hints, Tips & Accounting Systems at
> http://www.granite.ab.ca/accsmstr.htm
> Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
>
==============================================================================
TOPIC: Creating a query with Multi select list boxes
http://groups.google.com/group/microsoft.public.access.modulesdaovba/browse_thread/thread/62d81110c3598798?hl=en
==============================================================================
== 1 of 4 ==
Date: Wed, Nov 21 2007 4:05 am
From: BWD
Thanks for your reponse. I made the changes to the text field value
and then inserted the "IN" statement to the query's SQL. This did not
produce results.
I then tried to manually enter the string values:
"Value1","Value2","Value3" etc. into the paramter field in the QBD
grid. The query did not like this format it would only produce
results when I specifically entered values in the fomat of; "Value1"
OR "Value2" OR "Value3" etc.
Perhaps it is the way I am writing the "IN" part of the SQL
statement?
Again, any help would be appreciated.
== 2 of 4 ==
Date: Wed, Nov 21 2007 5:10 am
From: BWD
On Nov 21, 7:05 am, BWD <sa...@businesswebdesigns.net> wrote:
> Thanks for your reponse. I made the changes to the text field value
> and then inserted the "IN" statement to the query's SQL. This did not
> produce results.
>
> I then tried to manually enter the string values:
> "Value1","Value2","Value3" etc. into the paramter field in the QBD
> grid. The query did not like this format it would only produce
> results when I specifically entered values in the fomat of; "Value1"
> OR "Value2" OR "Value3" etc.
>
> Perhaps it is the way I am writing the "IN" part of the SQL
> statement?
>
> Again, any help would be appreciated.
ADDITION TO LAST MESSAGE:
Perhaps it will be helpful to add the SQL that I generated for this:
SELECT *
FROM [Table Name]
WHERE (((Table].FieldName)="In (" & FormName.FieldName & ")"));
This SQL is still not working for me.
Thanks
== 3 of 4 ==
Date: Wed, Nov 21 2007 6:53 am
From: LarryP
Let me get my head around this. You have four list boxes, each of which
generates a selected value. Are all those values to be applied as criteria
against ONE field in your query, or against DIFFERENT fields? In my
experience the latter seems more likely. Please clarify.
"BWD" wrote:
> Hi Group,
>
> In a bind here; I have a form with 4 multi select list boxes. What I
> would like to do is create a query that utilizes the values selected
> in the 4 list boxes. I have gotten as far as creating a text box on
> my form that records the values selected in the multi list. This text
> box value is in the format of "Value1" or "Value2" or "Value3" etc.
>
> However, setting the query parameter to my text box value does not
> yield the results I am looking for. Can anyone provide some
> guidance??
>
> Thanks much!
>
== 4 of 4 ==
Date: Wed, Nov 21 2007 10:33 am
From: "Stuart McCall"
"BWD" <sales@businesswebdesigns.net> wrote in message
news:48544e24-bf11-4960-be53-9e2b90b658c0@c29g2000hsa.googlegroups.com...
> On Nov 21, 7:05 am, BWD <sa...@businesswebdesigns.net> wrote:
>> Thanks for your reponse. I made the changes to the text field value
>> and then inserted the "IN" statement to the query's SQL. This did not
>> produce results.
>>
>> I then tried to manually enter the string values:
>> "Value1","Value2","Value3" etc. into the paramter field in the QBD
>> grid. The query did not like this format it would only produce
>> results when I specifically entered values in the fomat of; "Value1"
>> OR "Value2" OR "Value3" etc.
>>
>> Perhaps it is the way I am writing the "IN" part of the SQL
>> statement?
>>
>> Again, any help would be appreciated.
>
> ADDITION TO LAST MESSAGE:
>
> Perhaps it will be helpful to add the SQL that I generated for this:
>
> SELECT *
> FROM [Table Name]
> WHERE (((Table].FieldName)="In (" & FormName.FieldName & ")"));
>
> This SQL is still not working for me.
> Thanks
The problem here is the equals sign. Get rid of it. "In", used in this
context, is an operator, as is the equals sign.
SELECT *
FROM [Table Name]
WHERE Table].FieldName In (" & FormName.FieldName & ")";
For clarity, I've removed the parantheses that the query designer adds. It's
ok to remove them because the designer only uses them internally, to make
its parsing more precise.
Hope that cracks it.
==============================================================================
TOPIC: determining if this is the first new record in a subform
http://groups.google.com/group/microsoft.public.access.modulesdaovba/browse_thread/thread/32f8708d3a999813?hl=en
==============================================================================
== 1 of 2 ==
Date: Wed, Nov 21 2007 4:18 am
From: "Allen Browne"
Tables look right. I would probably use AutoNumber for the ID fields rather
than text, but it would work as you have it.
There is no direct relationships between:
tblProjectTypeStep.StepNum : tblProjectStep.StepNum
--
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.
"ArielZusya" <ArielZusya@discussions.microsoft.com> wrote in message
news:A809FE4E-5BC1-44F5-90B3-FAAE090CA71A@microsoft.com...
> Hmm... well... before I get too deep in here, I want to make sure I
> follow.
> Also, so we're speaking the same language, instead of having you guess at
> the
> structure of my tables I'll just use your example tables to learn how to
> do
> this and then I'll adapt it later to fit my db (which may be the wrong
> structure and needs revamping anyhow *GRIN*). So... I think I followed
> most
> of the table structure you wrote about but I want to be sure... so...
> here's
> what I understood your post to need:
>
> Tables:
>
> tblProject.ProjectID (Primary Key - Text - holds the description of the
> project)
> tblProject.ProjectType (Text - project name from tblProjectType)
> tblProject.ClientID (Text - holds the name of the client)
> tblProject.DueDate (Date/Time - holds the date the project is due)
>
> tblProjectStep.ProjectID (Primary Key - Text - description from
> tblProject)
> tblProjectStep.StepNum (Primary Key - Text - StepNum from tblProjectStep)
> tblProjectStep.ToolID (Primary Key - Text - ToolID from tblTool)
> tblProjectStep.StepDate (Date/Time - holds the date that the step
> happened)
>
> tblProjectType.ProjectTypeID (Primary Key - Text - ex: "chair")
>
> tblProjectTypeStep.ProjectTypeID (Primary Key - Text)
> tblProjectTypeStep.StepNum (Primary Key - Text)
> tblProjectTypeStep.ToolID (Text - ToolID from tblTool)
>
> tblTool.ToolID (Primary Key - Text - holds the name of the tool)
>
> Relationships:
>
> One : Many
>
> tblProjectType.ProjectTypeID : tblProjectTypeStep.ProjectTypeID
> tblTool.ToolID : tblProjectTypeStep.ToolID
> tblProjectTypeStep.StepNum : tblProjectStep.StepNum
> tblTool.ToolID : tblProjectStep.ToolID
> tblProject.ProjectID : tblProjectStep.ProjectID
>
>
> Is that right so far? I didn't want to start teaching myself what the
> code
> means before getting the tables right. Incidentally, this is also my
> first
> experience with using two fields as primary keys (I feel like such a
> n00b).
> Anyhow... let me know. Thanks for your help (and patience *GRIN*)!
>
> --Ariel
>
> "Allen Browne" wrote:
>
>> The answer to your question will depend on how you have set your tables
>> up.
>>
>> It sounds like you need to teach Access the steps required to complete a
>> project. You could define that with tables like this:
>>
>> Tool table (one record for each type of tool), with fields:
>> - ToolID (primary key)
>>
>> ProjectType (one record for each type of thing you build.) Fields:
>> - ProjectTypeID (e.g. chair)
>>
>> ProjectTypeStep table
>> - ProjectTypeID
>> - StepNum
>> - ToolID
>> (Primary key is ProjectTypeID + StepNum.)
>>
>> Now that the database knows the steps for each type of project, you can
>> create the tables for the actual projects you do, like this:
>>
>> Project table (one record for each project you take on):
>> - ProjectID
>> - ProjectType
>> - ClientID (who this project is for.)
>> - DueDate (when you're supposed to finish this.)
>>
>> ProjectStep table (one record for each step of a project):
>> - ProjectID Which project
>> - StepNum Which Step of the project.
>> - ToolID: Tool for this step
>> - StepDate: Date/Time (when you started this step.)
>>
>> I suspect you already have something like these 2 tables, with the form
>> and
>> subform. If so, you can use the BeforeInsert event procedure of the
>> subform
>> to look up the last step, figure out the next step and tool number, and
>> assign them to this new record.
>>
>> This is untested aircode only, and needs debugging, but should give you
>> the
>> idea:
>>
>> Private Sub Form_BeforeInsert(Cancel As Integer)
>> Dim rs As DAO.Recordset
>> Dim strWhere As String
>> Dim strSql As String
>> Dim varResult As Variant
>> Const strcStub = "SELECT StepNum, ToolID " & vbCrLf & _
>> "FROM ProjectTypeStep INNER JOIN Project " & _
>> "ON ProjectTypeStepID = Project.ProjectTypeID " & vbCrLf & _
>> "WHERE ("
>> Const strcTail = ") " & vbCrLf & "ORDER BY StepNum;"
>>
>> With Me.Parent
>> If IsNull(!ProjectID) Then
>> Cancel = True
>> MsgBox "Enter the project in the main form first."
>> Else
>> strWhere = "ProjectID = " & !ProjectID
>> varResult = DMax("StepNum", "ProjectStep", strWhere)
>> If Not IsNull(varResult) Then
>> strWhere = strWhere & ") AND (StepNum > " & varResult
>> End If
>> strSql = strcStub & strWhere & strcTail
>> 'Debug.Print strSql
>> Set rs = dbEngine(0)(0).OpenRecordset(strSql)
>> If Not rs.RecordCount = 0 Then
>> Me.StepNum = rs!StepNum
>> Me.ToolID = rs!ToolID
>> End If
>> rs.Close
>> Set rs = Nothing
>> End If
>> End With
>> End Sub
>>
>> "ArielZusya" <ArielZusya@discussions.microsoft.com> wrote in message
>> news:0DBEF3D6-4F75-4FA0-8107-AFDBCDA505EB@microsoft.com...
>> > I've got a form that uses subforms to display/enter data associated
>> > with a
>> > parent record. The "parent" is each day on a project and the "child"
>> > is
>> > each
>> > tool used for the project on that day. So... if project number 37,
>> > building
>> > a chair, requires green hammer and a blue saw on 11/27/07 the form
>> > would
>> > tell
>> > me that "chair" with ID 37 is associated with green hammer (tool1) and
>> > blue
>> > saw (tool2). And then if project number 37, building a char, requires
>> > a
>> > yellow level (tool3) and a purple tape measure (tool4) on 11/28/07,
>> > there
>> > would be a new record for 11/28 with that information in the submenu. I
>> > want
>> > to write code that will determine if this is the first new child record
>> > associated with the parent project or if not what the last child record
>> > entered associated with this project is and then populate the child's
>> > tool#
>> > with the next sequential tool# but I'm not sure where to even begin (I
>> > probably don't even have the lingo right). In other words, if on
>> > 11/29/07
>> > I
>> > go to enter the tools needed that day for the chair project (#37) I'd
>> > like
>> > it
>> > to know that the next sequential tool # is tool5 even though the
>> > current
>> > record is only linked to the 11/28 record by that 37. This sounds so
>> > much
>> > more complicated than it actually is... hopefully someone will be able
>> > to
>> > understand what I'm trying to do. Any suggestions? Thanks!
== 2 of 2 ==
Date: Wed, Nov 21 2007 8:05 am
From: ArielZusya
Hi Allen,
Thanks for all your help. Maybe it's the recent drop in temp or the
upcoming trip to tryptophan land, but I'm feeling lost and confused. So...
first... I tried changing the ID fields to autonumber and it gave me all
sorts of errors in the subform... so I switched back to text. Second, I got
rid of the relationship you suggested should not have been there and added
one more relationship that was missing from my original list:
One : Many
tblProjectType.ProjectTypeID : tblProject.ProjectType
Third, to avoid confusion I made the following changes:
tblProjectStep.StepNum is now tblProjectStep.ProjectStepNum
tblProjectTypeStep.StepNum is now tblProjectTypeStep.TypeStepNum
Then, I changed the code accordingly:
Private Sub Form_BeforeInsert(Cancel As Integer)
Dim rs As DAO.Recordset
Dim strWhere As String
Dim strSql As String
Dim varResult As Variant
Const strcStub = "SELECT ProjectStepNum, ToolID " & vbCrLf & _
"FROM ProjectTypeStep INNER JOIN Project " & _
"ON ProjectTypeStepID = Project.ProjectTypeID " & vbCrLf & "WHERE ("
Const strcTail = ") " & vbCrLf & "ORDER BY ProjectStepNum;"
With Me.Parent
If IsNull(!ProjectID) Then
Cancel = True
MsgBox "Enter the project in the main form first."
Else
strWhere = "ProjectID = " & !ProjectID
varResult = DMax("ProjectStepNum", "tblProjectStep", strWhere)
If Not IsNull(varResult) Then
strWhere = strWhere & ") AND (ProjectStepNum > " & varResult
End If
strSql = strcStub & strWhere & strcTail
'Debug.Print strSql
Set rs = DBEngine(0)(0).OpenRecordset(strSql)
If Not rs.RecordCount = 0 Then
Me.ProjectStepNum = rs!ProjectStepNum
Me.ToolID = rs!ToolID
End If
rs.Close
Set rs = Nothing
End If
End With
End Sub
In terms of forms I just used the form wizard to create a justified form
based on tblProject for the main form (frmProject). I then used the wizard
to create a justified form based on tblProjectStep for the subform
(frmProjectStep). I then set the sub as a continuous form and added your
code to the "BeforeInsert" function. Finally, I added the subform to the main
form. When I open the main form and start typing something into the subform,
your code catches the "enter something in the main form first" errors. The
trouble is, when I have something in the main form and then start entering
something in the subform it gets caught at:
Set rs = DBEngine(0)(0).OpenRecordset(strSql)
with an error of:
Run-time error '3296':
Join expression not supported.
What am I doing wrong? do I have all of this setup properly now? Thanks
again for all your help!
Ariel
"Allen Browne" wrote:
> Tables look right. I would probably use AutoNumber for the ID fields rather
> than text, but it would work as you have it.
>
> There is no direct relationships between:
> tblProjectTypeStep.StepNum : tblProjectStep.StepNum
>
> --
> 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.
>
> "ArielZusya" <ArielZusya@discussions.microsoft.com> wrote in message
> news:A809FE4E-5BC1-44F5-90B3-FAAE090CA71A@microsoft.com...
> > Hmm... well... before I get too deep in here, I want to make sure I
> > follow.
> > Also, so we're speaking the same language, instead of having you guess at
> > the
> > structure of my tables I'll just use your example tables to learn how to
> > do
> > this and then I'll adapt it later to fit my db (which may be the wrong
> > structure and needs revamping anyhow *GRIN*). So... I think I followed
> > most
> > of the table structure you wrote about but I want to be sure... so...
> > here's
> > what I understood your post to need:
> >
> > Tables:
> >
> > tblProject.ProjectID (Primary Key - Text - holds the description of the
> > project)
> > tblProject.ProjectType (Text - project name from tblProjectType)
> > tblProject.ClientID (Text - holds the name of the client)
> > tblProject.DueDate (Date/Time - holds the date the project is due)
> >
> > tblProjectStep.ProjectID (Primary Key - Text - description from
> > tblProject)
> > tblProjectStep.StepNum (Primary Key - Text - StepNum from tblProjectStep)
> > tblProjectStep.ToolID (Primary Key - Text - ToolID from tblTool)
> > tblProjectStep.StepDate (Date/Time - holds the date that the step
> > happened)
> >
> > tblProjectType.ProjectTypeID (Primary Key - Text - ex: "chair")
> >
> > tblProjectTypeStep.ProjectTypeID (Primary Key - Text)
> > tblProjectTypeStep.StepNum (Primary Key - Text)
> > tblProjectTypeStep.ToolID (Text - ToolID from tblTool)
> >
> > tblTool.ToolID (Primary Key - Text - holds the name of the tool)
> >
> > Relationships:
> >
> > One : Many
> >
> > tblProjectType.ProjectTypeID : tblProjectTypeStep.ProjectTypeID
> > tblTool.ToolID : tblProjectTypeStep.ToolID
> > tblProjectTypeStep.StepNum : tblProjectStep.StepNum
> > tblTool.ToolID : tblProjectStep.ToolID
> > tblProject.ProjectID : tblProjectStep.ProjectID
> >
> >
> > Is that right so far? I didn't want to start teaching myself what the
> > code
> > means before getting the tables right. Incidentally, this is also my
> > first
> > experience with using two fields as primary keys (I feel like such a
> > n00b).
> > Anyhow... let me know. Thanks for your help (and patience *GRIN*)!
> >
> > --Ariel
> >
> > "Allen Browne" wrote:
> >
> >> The answer to your question will depend on how you have set your tables
> >> up.
> >>
> >> It sounds like you need to teach Access the steps required to complete a
> >> project. You could define that with tables like this:
> >>
> >> Tool table (one record for each type of tool), with fields:
> >> - ToolID (primary key)
> >>
> >> ProjectType (one record for each type of thing you build.) Fields:
> >> - ProjectTypeID (e.g. chair)
> >>
> >> ProjectTypeStep table
> >> - ProjectTypeID
> >> - StepNum
> >> - ToolID
> >> (Primary key is ProjectTypeID + StepNum.)
> >>
> >> Now that the database knows the steps for each type of project, you can
> >> create the tables for the actual projects you do, like this:
> >>
> >> Project table (one record for each project you take on):
> >> - ProjectID
> >> - ProjectType
> >> - ClientID (who this project is for.)
> >> - DueDate (when you're supposed to finish this.)
> >>
> >> ProjectStep table (one record for each step of a project):
> >> - ProjectID Which project
> >> - StepNum Which Step of the project.
> >> - ToolID: Tool for this step
> >> - StepDate: Date/Time (when you started this step.)
> >>
> >> I suspect you already have something like these 2 tables, with the form
> >> and
> >> subform. If so, you can use the BeforeInsert event procedure of the
> >> subform
> >> to look up the last step, figure out the next step and tool number, and
> >> assign them to this new record.
> >>
> >> This is untested aircode only, and needs debugging, but should give you
> >> the
> >> idea:
> >>
> >> Private Sub Form_BeforeInsert(Cancel As Integer)
> >> Dim rs As DAO.Recordset
> >> Dim strWhere As String
> >> Dim strSql As String
> >> Dim varResult As Variant
> >> Const strcStub = "SELECT StepNum, ToolID " & vbCrLf & _
> >> "FROM ProjectTypeStep INNER JOIN Project " & _
> >> "ON ProjectTypeStepID = Project.ProjectTypeID " & vbCrLf & _
> >> "WHERE ("
> >> Const strcTail = ") " & vbCrLf & "ORDER BY StepNum;"
> >>
> >> With Me.Parent
> >> If IsNull(!ProjectID) Then
> >> Cancel = True
> >> MsgBox "Enter the project in the main form first."
> >> Else
> >> strWhere = "ProjectID = " & !ProjectID
> >> varResult = DMax("StepNum", "ProjectStep", strWhere)
> >> If Not IsNull(varResult) Then
> >> strWhere = strWhere & ") AND (StepNum > " & varResult
> >> End If
> >> strSql = strcStub & strWhere & strcTail
> >> 'Debug.Print strSql
> >> Set rs = dbEngine(0)(0).OpenRecordset(strSql)
> >> If Not rs.RecordCount = 0 Then
> >> Me.StepNum = rs!StepNum
> >> Me.ToolID = rs!ToolID
> >> End If
> >> rs.Close
> >> Set rs = Nothing
> >> End If
> >> End With
> >> End Sub
> >>
> >> "ArielZusya" <ArielZusya@discussions.microsoft.com> wrote in message
> >> news:0DBEF3D6-4F75-4FA0-8107-AFDBCDA505EB@microsoft.com...
> >> > I've got a form that uses subforms to display/enter data associated
> >> > with a
> >> > parent record. The "parent" is each day on a project and the "child"
> >> > is
> >> > each
> >> > tool used for the project on that day. So... if project number 37,
> >> > building
> >> > a chair, requires green hammer and a blue saw on 11/27/07 the form
> >> > would
> >> > tell
> >> > me that "chair" with ID 37 is associated with green hammer (tool1) and
> >> > blue
> >> > saw (tool2). And then if project number 37, building a char, requires
> >> > a
> >> > yellow level (tool3) and a purple tape measure (tool4) on 11/28/07,
> >> > there
> >> > would be a new record for 11/28 with that information in the submenu. I
> >> > want
> >> > to write code that will determine if this is the first new child record
> >> > associated with the parent project or if not what the last child record
> >> > entered associated with this project is and then populate the child's
> >> > tool#
> >> > with the next sequential tool# but I'm not sure where to even begin (I
> >> > probably don't even have the lingo right). In other words, if on
> >> > 11/29/07
> >> > I
> >> > go to enter the tools needed that day for the chair project (#37) I'd
> >> > like
> >> > it
> >> > to know that the next sequential tool # is tool5 even though the
> >> > current
> >> > record is only linked to the 11/28 record by that 37. This sounds so
> >> > much
> >> > more complicated than it actually is... hopefully someone will be able
> >> > to
> >> > understand what I'm trying to do. Any suggestions? Thanks!
>
>
==============================================================================
TOPIC: Search Form
http://groups.google.com/group/microsoft.public.access.modulesdaovba/browse_thread/thread/e59eb5434290efac?hl=en
==============================================================================
== 1 of 2 ==
Date: Wed, Nov 21 2007 4:26 am
From: "Allen Browne"
Presumably you have a one-to-many relationship between buyers and emails, so
your email table has a foreign key named BuyerNum.
If so, you need to DLookup() the BuyerNum for the particular email. You can
then use this number in your string.
This kind of thing:
Dim strWhere As String
Dim varResult As Variant
strWhere = "EmailID = " & Me.[EmailID]
varResult = DLookup("BuyerNum", "EmailTable", strWhere)
If IsNull(varResult) then
MsgBox "Email ID not found"
Else
stLinkCriteria = "BuyerNum = " & varResult
'Now use the string as you expect to.
End If
If you need help with DLookup(), see:
http://allenbrowne.com/casu-07.html
--
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.
"mattieflo" <mattieflo@discussions.microsoft.com> wrote in message
news:C37F8B79-F4D1-4658-AEC4-ACA0B90D1FD9@microsoft.com...
> Hello, I'm trying to write a search form that will search a main form for
> fields. The main form consists of several of several subforms. The
> following
> piece of code successfully searches for the Buyer Field on the main field.
>
> Private Sub cmdSearchBuyer_Click()
>
> Dim stbuyernumber As String
> Dim stDocName As String
> Dim stLinkCriteria As String
>
>
> stbuyernumber = InputBox("Enter Buyer Number", "Search Buyer
> Number")
> If stbuyernumber <> "" Then
> stDocName = "frmMain2"
> stLinkCriteria = "[tblBuyer].[BuyerNum] = " & stbuyernumber
> DoCmd.OpenForm stDocName, , , stLinkCriteria
> DoCmd.Close acForm, "frmSearch"
> End If
>
>
> A buyer can have many emails. I have an EMAIL subform that is linked to
> the
> BUYER mainform. I want to search for the primary key of the email subform
> (EmailID) so that it brings up the appropriate parent buyer number. Is
> there
> a way to adjust this line in the code so it does that?
>
> "stLinkCriteria = "[tblBuyer].[BuyerNum] = " & stbuyernumber"
>
> Thanks!
>
>
> End Sub
== 2 of 2 ==
Date: Wed, Nov 21 2007 8:25 am
From: mattieflo
Thanks for that Allen. It worked like a charm for this and will come in handy
for the future. Greatly appreciated!
"Allen Browne" wrote:
> Presumably you have a one-to-many relationship between buyers and emails, so
> your email table has a foreign key named BuyerNum.
>
> If so, you need to DLookup() the BuyerNum for the particular email. You can
> then use this number in your string.
>
> This kind of thing:
>
> Dim strWhere As String
> Dim varResult As Variant
> strWhere = "EmailID = " & Me.[EmailID]
> varResult = DLookup("BuyerNum", "EmailTable", strWhere)
> If IsNull(varResult) then
> MsgBox "Email ID not found"
> Else
> stLinkCriteria = "BuyerNum = " & varResult
> 'Now use the string as you expect to.
> End If
>
> If you need help with DLookup(), see:
>
http://allenbrowne.com/casu-07.html
>
> --
> 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.
>
> "mattieflo" <mattieflo@discussions.microsoft.com> wrote in message
> news:C37F8B79-F4D1-4658-AEC4-ACA0B90D1FD9@microsoft.com...
> > Hello, I'm trying to write a search form that will search a main form for
> > fields. The main form consists of several of several subforms. The
> > following
> > piece of code successfully searches for the Buyer Field on the main field.
> >
> > Private Sub cmdSearchBuyer_Click()
> >
> > Dim stbuyernumber As String
> > Dim stDocName As String
> > Dim stLinkCriteria As String
> >
> >
> > stbuyernumber = InputBox("Enter Buyer Number", "Search Buyer
> > Number")
> > If stbuyernumber <> "" Then
> > stDocName = "frmMain2"
> > stLinkCriteria = "[tblBuyer].[BuyerNum] = " & stbuyernumber
> > DoCmd.OpenForm stDocName, , , stLinkCriteria
> > DoCmd.Close acForm, "frmSearch"
> > End If
> >
> >
> > A buyer can have many emails. I have an EMAIL subform that is linked to
> > the
> > BUYER mainform. I want to search for the primary key of the email subform
> > (EmailID) so that it brings up the appropriate parent buyer number. Is
> > there
> > a way to adjust this line in the code so it does that?
> >
> > "stLinkCriteria = "[tblBuyer].[BuyerNum] = " & stbuyernumber"
> >
> > Thanks!
> >
> >
> > End Sub
>
>
==============================================================================
TOPIC: Commndbars collection does not contain menus?
http://groups.google.com/group/microsoft.public.access.modulesdaovba/browse_thread/thread/2c72c6e2e92ddb08?hl=en
==============================================================================
== 1 of 3 ==
Date: Wed, Nov 21 2007 4:28 am
From: redtux
running the folloing code (from helpfiles)
For Each cb In CommandBars("Menu bar")
If cb.name = "Forms" Then
' cb.Protection = msoBarNoChangeDock
' cb.Visible = True
foundflag = True
Debug.Print cb.name
End If
Next cb
If Not foundflag Then
MsgBox "The collection does not contain a Forms command bar."
End If
results in the popup box coming up
How do I look through available menus?
== 2 of 3 ==
Date: Wed, Nov 21 2007 6:58 am
From: "Albert D. Kallal"
Try:
Dim cb As CommandBarControl
Dim FOUNDFLAG As Boolean
For Each cb In CommandBars("Menu Bar").Controls
Debug.Print cb.Caption
Next
For a "contorl", you use the caption setting...there is no "name" setting..
above output is:
&File
&Edit
&View
&Relationships
&Insert
&Query
&Diagram
F&ormat
&Records
&PivotTable
&PivotChart
Filte&r
&Run
&Tools
&Window
&Help
The menu bar "menu bar" does not contain the "forms" menu.
you can all via
Dim cb As CommandBar <---- note
Dim FOUNDFLAG As Boolean
For Each cb In CommandBars
Debug.Print cb.Name
Next
We get:
Task Pane
Database
Menu Bar
Report Design
Form Design
Toolbox
Source Code Control
test1
Font/Fore Color
Fill/Back Color
Line/Border Style
Line/Border Width
Line/Border Color
Special Effect
Form View
etc. etc.
If you not seeing the additional data types you need to set a references (in
tools->references in code) to:
Microsoft Office 11.0 Object library (office 2003 = 11, office 2002 = 10
...etc).
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com
== 3 of 3 ==
Date: Wed, Nov 21 2007 8:56 am
From: redtux
"Albert D. Kallal" wrote:
> Try:
>
> Dim cb As CommandBarControl
> Dim FOUNDFLAG As Boolean
>
> For Each cb In CommandBars("Menu Bar").Controls
> Debug.Print cb.Caption
> Next
>
> For a "contorl", you use the caption setting...there is no "name" setting..
>
> above output is:
>
> &File
> &Edit
> &View
> &Relationships
> &Insert
> &Query
> &Diagram
> F&ormat
> &Records
> &PivotTable
> &PivotChart
> Filte&r
> &Run
> &Tools
> &Window
> &Help
>
> The menu bar "menu bar" does not contain the "forms" menu.
>
> you can all via
>
>
> Dim cb As CommandBar <---- note
> Dim FOUNDFLAG As Boolean
>
> For Each cb In CommandBars
> Debug.Print cb.Name
> Next
>
> We get:
>
> Task Pane
>
> Database
> Menu Bar
> Report Design
> Form Design
> Toolbox
> Source Code Control
> test1
> Font/Fore Color
> Fill/Back Color
> Line/Border Style
> Line/Border Width
> Line/Border Color
> Special Effect
> Form View
> etc. etc.
>
> If you not seeing the additional data types you need to set a references (in
> tools->references in code) to:
>
> Microsoft Office 11.0 Object library (office 2003 = 11, office 2002 = 10
> ....etc).
>
> --
> Albert D. Kallal (Access MVP)
> Edmonton, Alberta Canada
> pleaseNOOSpamKallal@msn.com
>
>
>
>
thanks
==============================================================================
TOPIC: exif data from jpg's
http://groups.google.com/group/microsoft.public.access.modulesdaovba/browse_thread/thread/4b577c7fec3e2b7e?hl=en
==============================================================================
== 1 of 1 ==
Date: Wed, Nov 21 2007 5:21 am
From: "Albert D. Kallal"
"CDev" <CDev@discussions.microsoft.com> wrote in message
news:51E75D73-8761-442E-B397-E424F62CC1FA@microsoft.com...
> Albert
>
> Once again, your assistance has been greatly appreciated!
>
> In addition to your instruction below, I had to do the following:
> - Add the text in the IFDData.cls file to a new Class Module in my Access
> 2003 app.
I don't know where the above IFDDdata.cls file comes from. You don't need
it.
The download I was
talking about is here:
http://sourceforge.net/projects/exifclass/
From the above, the zip file reuslts in TWO files
ExifReader.cls
and
Readme.txt
You simply do the cut/paste into a new "class", module, and you should be
fine.
>- Change clsPic.picFile = "c:\1.jpg" to clsPic.Load "c:\1.jpg"
Yes, that seems like a mistake on my part (sorry).
I suggest you use load aways...
>Tag(DateTimeOriginal)
I not looked as to what the difference is between DateTime, and Datetime
Original......
I suspect this will depend on the original camera...and how it is setup....
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com
==============================================================================
TOPIC: How do I return a Percentile Rank in Microsoft Access?
http://groups.google.com/group/microsoft.public.access.modulesdaovba/browse_thread/thread/ae9f54d2818421f3?hl=en
==============================================================================
== 1 of 1 ==
Date: Wed, Nov 21 2007 5:33 am
From: "Gary Walter"
Hi bob,
Unless this is for homework....
{meaning no offense}
please stop what you are doing and
go out and get a good book on database
and table design...honestly.
Do you anticipate "making" tables Product_2,
Product_3, Product_4, etc.? For what?
...or maybe I just don't understand...
In the calc for
Percentile = (Rank/TotCnt) * 100
is TotCnt over entire DataSet,
or over the filtered DataSet?
If "over filtered DataSet"....
Method 1) Divide and conquer
(recommend)
qryPreFilter:
SELECT Category, [Name], [Value]
FROM DataSet
WHERE (((Category)="Product_1"));
SELECT
Q.Category,
Q.[Name],
Q.[Value],
DCount("*","qryPreFilter", "[Value]<" & Q.[Value] ) AS ValRank,
DCount("*","qryPreFilter") AS TotCnt,
([ValRank]/[TotCnt])*100 AS Percentile
INTO Product_1
FROM qryPreFilter AS Q;
Method 2) Add filter to (one or both?) DCount
SELECT
D.Category,
D.[Name],
D.[Value],
DCount("*","DataSet", "[Value]<" & D.[Value],
"[Category] = 'Product_1'" ) AS ValRank,
DCount("*","DataSet","[Category]='Product_1'") AS TotCnt,
([ValRank]/[TotCnt])*100 AS Percentile
INTO Product_1
FROM DataSet AS D
WHERE D.Category = "Product_1";
Method 3) Update after make table
SELECT
D.Category,
D.[Name],
D.[Value],
IIf(True,Null,CDbl(0)) AS Percentile
INTO Product_1
FROM DataSet AS D
WHERE D.Category = "Product_1";
UPDATE Product_1 AS P SET
P.Percentile =
( DCount("*","Product_1", "[Value]<" & P.[Value]) /
DCount("*","Product_1") ) * 100;
good luck (with your homework?),
gary
"bobmount" wrote:
>....It seems like your query WOULD achieve what I'm after, but I
> can't seem to get the syntax right for use within an existing "Make Table"
> query in Access.
>
> Basically, I'd like to simply add the percentile_rank fields (as, I think,
> you've defined it) to the Access Query that's currently defined by the
> following SQL:
>
> SELECT Category, Name, Value INTO Product_1
> FROM DataSet
> WHERE (((Category)="Product_1"));
>
> Would you mind integrating your SQL into this structure? I've tried
> fiddling with it for hours, and can't seem to get it right....
>
> Thank you sooooo much (in advance!)....
>
> B
>
> "Gary Walter" wrote:
>
>>
>> "bobmount" wrote:
>> > I'm trying to add a field to a "Make Table" query in Access which will
>> > add
>> > a
>> > column representing the percentile rank of the [Value] field, based on
>> > the
>> > other values in that column (i.e., 1%-100%)....similar to the
>> > PERCENTILE
>> > RANK
>> > feature in Excel. Does anyone know how to do this? (Assume my table
>> > name
>> > is 'DataSet', and the field with the values to rank is [Value])....
>> >
>> Hi Bob,
>>
>> Are we talking about:
>>
>> Percentile = (Rank/TotalCount) * 100
>>
>> The following solution requires that you
>> be able to use DCount to produce a rank
>> and a total count over the group.
>>
>>
>> SELECT
>> D.[Value],
>> DCount("*","DataSet", "[Value]<" & D.[Value] ) AS ValRank,
>> DCount("*","DataSet") AS TotCnt,
>> ([ValRank]/[TotCnt])*100 AS Percentile
>> FROM DataSet AS D;
>>
>> the above won't resolve ties though (but can with
>> some other field added to DCount for ValRank...
>>
>> good luck,
>>
>> gary
>>
>>
>>
==============================================================================
TOPIC: Dynamic INSERT INTO command
http://groups.google.com/group/microsoft.public.access.modulesdaovba/browse_thread/thread/b86524aeb23f77e0?hl=en
==============================================================================
== 1 of 3 ==
Date: Wed, Nov 21 2007 6:17 am
From: Luis
Hello.
I'm trying to create a SQL Insert Into string where one of the fields is the
value of a certain variable.
How can i do this?
What i've done is the following:
INSERT INTO P (Btsm, Bts, Data, Hora," & pa_Out & ") VALUES ('" & btsm &
"','" & bts & "','" & dia & "','" & hora & "','" & pa_Out_value & "');"
Pa_Out is the name of the field.
== 2 of 3 ==
Date: Wed, Nov 21 2007 6:49 am
From: LarryP
There are people here who do this imbedded SQL stuff way better than I do,
but let's take a shot at it: are you trying to make the FIELD you're
inserting into dynamic, or the DATA you're inserting into it dynamic?
If the field you're inserting into is always the same then this should work;
the incoming data (pa_Out_value) would vary dynamically, but it would always
go into the pa_Out field:
"INSERT INTO P (Btsm, Bts, Data, Hora, pa_Out) VALUES ('" & btsm &
> "','" & bts & "','" & dia & "','" & hora & "','" & pa_Out_value & "');"
(assuming all your values are text; I see you have them all set off with
single quotes)
((((By the way, is the field really Data, since what you're trying to put
into it is dia? Maybe a typo there?))))
On the other hand, if you're trying to put the pa_out_Value bit of
information into a different field depending on ???whatever???, the
following would seem to be what you need. pa_Out would be the dynamic field
name you want to put pa_Out_value into; the incoming data would always be the
same, but the field it goes into would vary depending on pa_Out.
"INSERT INTO P (Btsm, Bts, Data, Hora," & pa_Out & ") VALUES ('" & btsm &
> "','" & bts & "','" & dia & "','" & hora & "','" & pa_Out_value & "');"
"Luis" wrote:
> Hello.
> I'm trying to create a SQL Insert Into string where one of the fields is the
> value of a certain variable.
>
> How can i do this?
> What i've done is the following:
>
> INSERT INTO P (Btsm, Bts, Data, Hora," & pa_Out & ") VALUES ('" & btsm &
> "','" & bts & "','" & dia & "','" & hora & "','" & pa_Out_value & "');"
>
> Pa_Out is the name of the field.
>
>
>
== 3 of 3 ==
Date: Wed, Nov 21 2007 7:11 am
From: "Douglas J. Steele"
On the surface, that SQL statement looks correct.
What happens when you try to run it? What should happen instead? How are you
running it?
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Luis" <Luis@discussions.microsoft.com> wrote in message
news:5C169854-A072-4C8C-9B96-0810F83EF466@microsoft.com...
> Hello.
> I'm trying to create a SQL Insert Into string where one of the fields is
> the
> value of a certain variable.
>
> How can i do this?
> What i've done is the following:
>
> INSERT INTO P (Btsm, Bts, Data, Hora," & pa_Out & ") VALUES ('" & btsm &
> "','" & bts & "','" & dia & "','" & hora & "','" & pa_Out_value & "');"
>
> Pa_Out is the name of the field.
>
>
>
==============================================================================
TOPIC: help with replace function
http://groups.google.com/group/microsoft.public.access.modulesdaovba/browse_thread/thread/8d3f93c1a139047b?hl=en
==============================================================================
== 1 of 3 ==
Date: Wed, Nov 21 2007 8:18 am
From: <@discussions.microsoft.com>
hi
i would like to replace substrings in txt files in folder and its subfolders
i have the sring to find and the string to replace in access table
it is my first time to do anything with vba
the function i found is here
Function Replace(ByVal Valuein As String, ByVal WhatToReplace As _
String, ByVal Replacevalue As String) As String
Dim Temp As String, P As Long
Temp = Valuein
P = InStr(Temp, WhatToReplace)
Do While P > 0
Temp = Left(Temp, P - 1) & Replacevalue & _
Mid(Temp, P + Len(WhatToReplace))
P = InStr(P + Len(Replacevalue), Temp, WhatToReplace, 1)
Loop
Replace = Temp
End Function
can someone help me with that?
thank you
== 2 of 3 ==
Date: Wed, Nov 21 2007 10:41 am
From: John W. Vinson
On Wed, 21 Nov 2007 08:18:03 -0800, ???? <@discussions.microsoft.com> wrote:
>hi
>
>i would like to replace substrings in txt files in folder and its subfolders
>
>i have the sring to find and the string to replace in access table
>
>it is my first time to do anything with vba
>
>the function i found is here
>
>
> Function Replace(ByVal Valuein As String, ByVal WhatToReplace As _
> String, ByVal Replacevalue As String) As String
> Dim Temp As String, P As Long
> Temp = Valuein
> P = InStr(Temp, WhatToReplace)
> Do While P > 0
> Temp = Left(Temp, P - 1) & Replacevalue & _
> Mid(Temp, P + Len(WhatToReplace))
> P = InStr(P + Len(Replacevalue), Temp, WhatToReplace, 1)
> Loop
> Replace = Temp
> End Function
>
>can someone help me with that?
>
>thank you
>
What version of Access are you using? There is now a builtin Replace()
function; this looks like a function which was written for Access97 or
earlier, which didn't have the function built in.
If you could describe what you're trying to accomplish (replace what, with
what, in which records???) we may be able to give you more specific help.
John W. Vinson [MVP]
== 3 of 3 ==
Date: Wed, Nov 21 2007 11:05 am
From: <@discussions.microsoft.com>
thank you for reply
i use access 2003
i would like to replace substrings that located in other folders and sub
folders on my pc such as names and adresses.
since they located in few files and there are many records in each file i
want to do it with macro from the db
in the db i have a table with 2 columns that contains the substring to find
and the substring to replace.
i hope i am clear now
thanks again
"John W. Vinson" wrote:
> On Wed, 21 Nov 2007 08:18:03 -0800, ???? <@discussions.microsoft.com> wrote:
>
> >hi
> >
> >i would like to replace substrings in txt files in folder and its subfolders
> >
> >i have the sring to find and the string to replace in access table
> >
> >it is my first time to do anything with vba
> >
> >the function i found is here
> >
> >
> > Function Replace(ByVal Valuein As String, ByVal WhatToReplace As _
> > String, ByVal Replacevalue As String) As String
> > Dim Temp As String, P As Long
> > Temp = Valuein
> > P = InStr(Temp, WhatToReplace)
> > Do While P > 0
> > Temp = Left(Temp, P - 1) & Replacevalue & _
> > Mid(Temp, P + Len(WhatToReplace))
> > P = InStr(P + Len(Replacevalue), Temp, WhatToReplace, 1)
> > Loop
> > Replace = Temp
> > End Function
> >
> >can someone help me with that?
> >
> >thank you
> >
>
> What version of Access are you using? There is now a builtin Replace()
> function; this looks like a function which was written for Access97 or
> earlier, which didn't have the function built in.
>
> If you could describe what you're trying to accomplish (replace what, with
> what, in which records???) we may be able to give you more specific help.
>
> John W. Vinson [MVP]
>
==============================================================================
You received this message because you are subscribed to the Google Groups "microsoft.public.access.modulesdaovba"
group.
To post to this group, visit http://groups.google.com/group/microsoft.public.access.modulesdaovba?hl=en
To unsubscribe from this group, send email to microsoft.public.access.modulesdaovba-unsubscribe@googlegroups.com
To change the way you get mail from this group, visit:
http://groups.google.com/group/microsoft.public.access.modulesdaovba/subscribe?hl=en
To report abuse, send email explaining the problem to abuse@googlegroups.com
==============================================================================
Google Groups: http://groups.google.com?hl=en
0 komentar:
Poskan Komentar