Selasa, 13 Desember 2022

Re: [MSAccessProfessionals] Basing an Expression off of Another Expression?

 

Hi Duane,

 

Thanks for the suggestion, but I still couldn't get it to quite work.  If the Old Expression (ADDR) had content then the New Expression (NEW ADDR) has the correct information. But if the New Field (ADDRESS COMPLETE) has an entry then nothing shows up in the Nex Expression (NEW ADDR).  I'm baffled!

 

Any other ideas?

 

 

From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> On Behalf Of Duane Hookom
Sent: Tuesday, December 13, 2022 11:32 AM
To: MSAccessProfessionals@groups.io
Subject: [EXTERNAL] Re: [MSAccessProfessionals] Basing an Expression off of Another Expression?

 

There is a Nz() function that might work:

New Address: Nz(ADDR, [Address Complete])

If ADDR is null then use the other field.

 

Duane



Price, Penny E. - DSD Admin Support Asst III



Hi Everyone!

 

I am wanting to update one of my databases to change how the address is input ….initially I had several fields that I used to signify an address. There was the Street Number (2244), the Street Direction (W), And the Street Name (Colfax Ave).  Since I often needed the entire address to refer to, I created a concatenated address as an Expression and named it ADDR.

 

Although hitting that Enter Key between the original fields doesn't slow my roll any, it does so for other potential users.  I created a New Field named ADDRESS COMPLETE into which the entire address can be entered.  HOWEVER: I still want to have one place that contains the entire address whether it was entered the old way (the 3 separate Fields) or the new way (into the New Field named  ADDRESS COMPLETE).

 

Is there a way to build a New Expression (NEW ADDR), based off whether the Old Expression (ADDR), has an address in it or not. If any of the previously mentioned concatenated fields are filled out, then this expression  should give the info (ADDR).,  otherwise the expression should show the results from the New Field (ADDRESS COMPLETE).   I've tried various iterations of the following but I always get an error.  Is this doable? Thanks Everybody and Happy Holidays to All!

 

NEW ADDRESS: IIf(IsNull([ADDR]),[[ADDRESS COMPLETE]),[ADDR]

Re: [MSAccessProfessionals] Basing an Expression off of Another Expression?

There is a Nz() function that might work:
New Address: Nz(ADDR, [Address Complete])
If ADDR is null then use the other field.

Duane


Price, Penny E. - DSD Admin Support Asst III


Hi Everyone!

 

I am wanting to update one of my databases to change how the address is input ….initially I had several fields that I used to signify an address. There was the Street Number (2244), the Street Direction (W), And the Street Name (Colfax Ave).  Since I often needed the entire address to refer to, I created a concatenated address as an Expression and named it ADDR.

 

Although hitting that Enter Key between the original fields doesn't slow my roll any, it does so for other potential users.  I created a New Field named ADDRESS COMPLETE into which the entire address can be entered.  HOWEVER: I still want to have one place that contains the entire address whether it was entered the old way (the 3 separate Fields) or the new way (into the New Field named  ADDRESS COMPLETE).

 

Is there a way to build a New Expression (NEW ADDR), based off whether the Old Expression (ADDR), has an address in it or not. If any of the previously mentioned concatenated fields are filled out, then this expression  should give the info (ADDR).,  otherwise the expression should show the results from the New Field (ADDRESS COMPLETE).   I've tried various iterations of the following but I always get an error.  Is this doable? Thanks Everybody and Happy Holidays to All!

 

NEW ADDRESS: IIf(IsNull([ADDR]),[[ADDRESS COMPLETE]),[ADDR]

_._,_._,_

[MSAccessProfessionals] Basing an Expression off of Another Expression?

Hi Everyone!

 

I am wanting to update one of my databases to change how the address is input ….initially I had several fields that I used to signify an address. There was the Street Number (2244), the Street Direction (W), And the Street Name (Colfax Ave).  Since I often needed the entire address to refer to, I created a concatenated address as an Expression and named it ADDR.

 

Although hitting that Enter Key between the original fields doesn’t slow my roll any, it does so for other potential users.  I created a New Field named ADDRESS COMPLETE into which the entire address can be entered.  HOWEVER: I still want to have one place that contains the entire address whether it was entered the old way (the 3 separate Fields) or the new way (into the New Field named  ADDRESS COMPLETE).

 

Is there a way to build a New Expression (NEW ADDR), based off whether the Old Expression (ADDR), has an address in it or not. If any of the previously mentioned concatenated fields are filled out, then this expression  should give the info (ADDR).,  otherwise the expression should show the results from the New Field (ADDRESS COMPLETE).   I’ve tried various iterations of the following but I always get an error.  Is this doable? Thanks Everybody and Happy Holidays to All!

 

NEW ADDRESS: IIf(IsNull([ADDR]),[[ADDRESS COMPLETE]),[ADDR]

 

 

 

 

 

 

Jumat, 09 Desember 2022

Re: [MSAccessProfessionals] Error handling VBA when connection to the network drive is lost

I have no idea if this actually works, but this is what ChatGPT suggests.

Inline image




On Thursday, December 8, 2022 at 07:26:46 PM CST, anzus101 <anzus101@gmail.com> wrote:


Hello guys, 

I am after a vba code you may have that could be used to kick you out from the app if the connection to the back end has been lost.

Could you please help?

Kamis, 08 Desember 2022

[MSAccessProfessionals] Error handling VBA when connection to the network drive is lost

Hello guys, 

I am after a vba code you may have that could be used to kick you out from the app if the connection to the back end has been lost.

Could you please help?
_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#116330) | Reply To Group | Reply To Sender | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_

Sabtu, 03 Desember 2022

Re: [MSAccessProfessionals] Save report with First_Name & Last_Name in PDF format

hi Ryan,

ahtCommonFileOpenSave is here:

http://www.theaccessweb.com/api/api0001.htm

let me know if you have 64-bit as I have code adjusted for that.

kind regards,
crystal

On 12/2/2022 11:53 PM, Ryan S wrote:
Hi, Lou.

What is ahtCommonFileOpenSave() for?
Why can't I find it? Do I have to activate certain references?

Thanks.
Ryan

On Wed, 23 Nov 2022 at 02:42, Duane Hookom <duanehookom@hotmail.com> wrote:

Hi Lou,

I have removed a lot of the extra copies of the same comments in this reply for ease of review. It isn't clear if you have tried setting a break point near the top of your code and stepping through. Also, adding some debug.Print lines in your code will help understand memory variables.


It might be an issue the record hasn't been saved prior to the code running.


Duane


On Mon, Nov 21, 2022 at 04:16 AM, Duane Hookom wrote:

 

I would try basic troubleshooting using a combination of breakpoints and debug.print to see what is going on with your code.  

  

Duane 

 

On Sun, Nov 20, 2022 at 06:41 AM, Giorgio Rovelli wrote: 

Did you set strFilter? Do you have *'s in the First_Name field? Maybe you should specify strWhere when you use DoCmd.OutputTo as well? 

LOU(at home) <lou@ix.net.au> wrote: 

  

Hello all, I haven't posted on here for many years! I'm now 76 years old and the old grey matter is slowing down :(
Today I went back to a database I first worked on 15 or so years ago with Access 97 I think.
I've now subscribed to Access 365 and found a few things no working, I've fixed a couple but this one has me stumped.
The code below belongs to a Button which when clicked would open allow me to save a record in pdf format and the default name of the file would be the First_Name & Last_Name of the open record.
When I click on it now, nothing happens!
Any help would be greatly appreciated.
Thank you, Lou
------------------------------ 

Private Sub Save_PDF_Button_Click() 

Dim strDocName As String 

Dim strWhere As String 

Dim strFilter As String 

Dim strInputFileName As String 

Dim strTitle As String 

Dim strSaveName As String 

strDocName = "Rel_View_Data_Rpt" 

    strWhere = "(ID)=" & Me!ID 

    DoCmd.OpenReport strDocName, acViewPreview, , strWhere 

    strTitle = "Save Report for " & Me.First_Name & "_" & Me.Last_Name & " in PDF Format" & "                        © Lou Lucano" 

   strSaveName = Replace(Me.First_Name, "*", "") 

     

'Ask for SaveFileName 

strSaveFileName = ahtCommonFileOpenSave( _ 

OpenFile:=False, _ 

Filter:=strFilter, _ 

FileName:=strSaveName & "_" & Me.[Last_Name] & ".pdf", DialogTitle:=strTitle, _ 

Flags:=ahtOFN_OVERWRITEPROMPT Or ahtOFN_PATHMUSTEXIST) 

If Len(strSaveFileName) = 0 Then 

 DoCmd.Close acReport, strDocName, acSaveNo 

Exit Sub 

End If 

  DoCmd.OutputTo acOutputReport, strDocName, acFormatPDF, strSaveFileName 

  

  DoCmd.Close acReport, strDocName, acSaveNo 

   

MsgBox Me.[First_Name] & " " & Me.[Last_Name] & " Report saved in PFD Format." 

   

End Sub 

 

Jumat, 02 Desember 2022

Re: [MSAccessProfessionals] Save report with First_Name & Last_Name in PDF format

Hi, Lou.

What is ahtCommonFileOpenSave() for?
Why can't I find it? Do I have to activate certain references?

Thanks.
Ryan

On Wed, 23 Nov 2022 at 02:42, Duane Hookom <duanehookom@hotmail.com> wrote:

Hi Lou,

I have removed a lot of the extra copies of the same comments in this reply for ease of review. It isn't clear if you have tried setting a break point near the top of your code and stepping through. Also, adding some debug.Print lines in your code will help understand memory variables.


It might be an issue the record hasn't been saved prior to the code running.


Duane


On Mon, Nov 21, 2022 at 04:16 AM, Duane Hookom wrote:

 

I would try basic troubleshooting using a combination of breakpoints and debug.print to see what is going on with your code.  

  

Duane 

 

On Sun, Nov 20, 2022 at 06:41 AM, Giorgio Rovelli wrote: 

Did you set strFilter? Do you have *'s in the First_Name field? Maybe you should specify strWhere when you use DoCmd.OutputTo as well? 

LOU(at home) <lou@ix.net.au> wrote: 

  

Hello all, I haven't posted on here for many years! I'm now 76 years old and the old grey matter is slowing down :(
Today I went back to a database I first worked on 15 or so years ago with Access 97 I think.
I've now subscribed to Access 365 and found a few things no working, I've fixed a couple but this one has me stumped.
The code below belongs to a Button which when clicked would open allow me to save a record in pdf format and the default name of the file would be the First_Name & Last_Name of the open record.
When I click on it now, nothing happens!
Any help would be greatly appreciated.
Thank you, Lou
------------------------------ 

Private Sub Save_PDF_Button_Click() 

Dim strDocName As String 

Dim strWhere As String 

Dim strFilter As String 

Dim strInputFileName As String 

Dim strTitle As String 

Dim strSaveName As String 

strDocName = "Rel_View_Data_Rpt" 

    strWhere = "(ID)=" & Me!ID 

    DoCmd.OpenReport strDocName, acViewPreview, , strWhere 

    strTitle = "Save Report for " & Me.First_Name & "_" & Me.Last_Name & " in PDF Format" & "                        © Lou Lucano" 

   strSaveName = Replace(Me.First_Name, "*", "") 

     

'Ask for SaveFileName 

strSaveFileName = ahtCommonFileOpenSave( _ 

OpenFile:=False, _ 

Filter:=strFilter, _ 

FileName:=strSaveName & "_" & Me.[Last_Name] & ".pdf", DialogTitle:=strTitle, _ 

Flags:=ahtOFN_OVERWRITEPROMPT Or ahtOFN_PATHMUSTEXIST) 

If Len(strSaveFileName) = 0 Then 

 DoCmd.Close acReport, strDocName, acSaveNo 

Exit Sub 

End If 

  DoCmd.OutputTo acOutputReport, strDocName, acFormatPDF, strSaveFileName 

  

  DoCmd.Close acReport, strDocName, acSaveNo 

   

MsgBox Me.[First_Name] & " " & Me.[Last_Name] & " Report saved in PFD Format." 

   

End Sub 

 

_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#116328) | Reply To Group | Reply To Sender | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_