<html><body style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 12px;">Thank you for your guidance Dan & Mikael.<br />Implementing your improvements;<br />in the wx module pw.erl<br /><br />export_usr(Pw, Un, Pwv, Unv, Usr) -> <br />case wxPasswordEntryDialog:connect(Pw, command_button_clicked, [{userData, Pwv}]) of<br /> ok -><br /> case wxTextEntryDialog:connect(Un, command_button_clicked, [{userData, Unv}]) of<br /> ok -><br /> io:format("~p: ~p ~n", [Usr, [#usr_record{un = Unv, pas = Pwv}]]),<br /> Pid = spawn(usrdb, handle_usr, [Usr]),<br /> register(usrdb, Pid),<br /> Pid ! {self(), Usr}<br /> end <br />end,<br />export_usr(Pw, Un, Pwv, Unv, Usr).<br /><br />Trying to send this value of Usr to;<br /><br />the mnesia module usrdb.erl<br /><br />handle_usr(Usr) when is_record(Usr, usr_record)-> <br /> io:format("~p ~n", [Usr]),<br /> {atomic, [Usr]} = mnesia:transaction(fun() -><br /> mnesia:write(usr_table, Usr, write) end),<br /> Usr.<br /><br />While this runs, no record in mnesia is found.<br />The first pw.erl function builds the window to gather user data before wx:show(Frame).<br />In the second function export_usr/5, wxPasswordEntryDialog etc is a repetition. <br />A variable can only be given a value once in its scope. <br />Does its scope end at wx:show(Frame)? (At the ' . ' of the first function?)<br />If so, what is the correct procedure to copy a variable's value to a subsequent function in a wx module?<br />Is there a better method for writing user data from a wx module into an mnesia table?<br />Thank you once again in advance for your insights.<br />Peter<br /><br /><div><br /></div><div><br /></div></body></html>